Add seeds for db

This commit is contained in:
rui hildt 2020-05-05 17:58:34 +02:00
parent fa8dfb8ebc
commit a6dd5bb7f4
5 changed files with 646 additions and 0 deletions

View File

@ -0,0 +1,50 @@
exports.seed = function (knex) {
// Deletes ALL existing entries
return knex('account')
.del()
.then(function () {
// Inserts seed entries
return knex('account').insert([
{
username: 'liza',
email: 'liza@example.com',
password: 'really-strong-password',
timezone: 'Europe/Brussels',
earliest_time: '09:30',
latest_time: '22:00',
},
{
username: 'emile',
email: 'emile@example.com',
password: 'really-strong-password',
timezone: 'America/New_York',
earliest_time: '09:00',
latest_time: '20:00',
},
{
username: 'jack',
email: 'jack@example.com',
password: 'really-strong-password',
timezone: 'Asia/Kolkata',
earliest_time: '10:30',
latest_time: '17:00',
},
{
username: 'cynthia',
email: 'cynthia@example.com',
password: 'really-strong-password',
timezone: 'Europe/Brussels',
earliest_time: '06:30',
latest_time: '12:00',
},
{
username: 'celine',
email: 'celine@example.com',
password: 'really-strong-password',
timezone: 'Europe/Brussels',
earliest_time: '10:30',
latest_time: '20:00',
},
]);
});
};

View File

@ -0,0 +1,76 @@
exports.seed = function (knex) {
// Deletes ALL existing entries
return knex('meeting')
.del()
.then(function () {
// Inserts seed entries
return knex('meeting').insert([
{
id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
title: 'Worldwide meeting I',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '10:30',
timezone: 'Europe/Brussels',
duration: 90,
status: 0,
password: 'simple-meeting-password',
},
{
id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
title: 'Worldwide meeting II',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '08:00',
timezone: 'America/New_York',
duration: 90,
status: 0,
password: 'simple-meeting-password',
},
{
id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
title: 'Worldwide meeting III',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '14:30',
timezone: 'Asia/Kolkata',
duration: 90,
status: 0,
password: 'simple-meeting-password',
},
{
id: 'aa639e05-be03-4202-a18e-aae3bc5153f0',
title: 'Worldwide meeting IV',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '19:00',
timezone: 'Asia/Sakhalin',
duration: 90,
status: 0,
password: 'simple-meeting-password',
},
{
id: 'a4a9b71a-91af-4e35-8377-96f56fa7f6b8',
title: 'Worldwide meeting V',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '06:00',
timezone: 'Antarctica/DumontDUrville',
duration: 90,
status: 0,
password: 'simple-meeting-password',
},
{
id: '741f300a-a137-499d-b725-73770ac6fe70',
title: 'Worldwide meeting VI',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '13:30',
timezone: 'Europe/Brussels',
duration: 90,
status: 0,
password: 'simple-meeting-password',
},
]);
});
};

View File

@ -0,0 +1,93 @@
exports.seed = function (knex) {
// Deletes ALL existing entries
return knex('possible_date')
.del()
.then(function () {
// Inserts seed entries
return knex('possible_date').insert([
// Meeting 1
{
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date: '2025-02-18',
},
{
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date: '2025-02-19',
},
{
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date: '2025-02-20',
},
{
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date: '2025-02-21',
},
// Meeting 2
{
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date: '2025-05-18',
},
{
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date: '2025-05-19',
},
{
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date: '2025-05-22',
},
// Meeting 3
{
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date: '2025-08-18',
},
{
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date: '2025-10-18',
},
{
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date: '2025-12-18',
},
// Meeting 4
{
meeting_id: 'aa639e05-be03-4202-a18e-aae3bc5153f0',
possible_date: '2025-06-18',
},
{
meeting_id: 'aa639e05-be03-4202-a18e-aae3bc5153f0',
possible_date: '2025-06-18',
},
// Meeting 5
{
meeting_id: 'a4a9b71a-91af-4e35-8377-96f56fa7f6b8',
possible_date: '2025-04-06',
},
{
meeting_id: 'a4a9b71a-91af-4e35-8377-96f56fa7f6b8',
possible_date: '2025-04-12',
},
{
meeting_id: 'a4a9b71a-91af-4e35-8377-96f56fa7f6b8',
possible_date: '2025-04-27',
},
// Meeting 6
{
meeting_id: '741f300a-a137-499d-b725-73770ac6fe70',
possible_date: '2025-06-16',
},
{
meeting_id: '741f300a-a137-499d-b725-73770ac6fe70',
possible_date: '2025-07-19',
},
{
meeting_id: '741f300a-a137-499d-b725-73770ac6fe70',
possible_date: '2025-08-21',
},
]);
});
};

View File

@ -0,0 +1,142 @@
exports.seed = function (knex) {
// Deletes ALL existing entries
return knex('participant')
.del()
.then(function () {
// Inserts seed entries
return knex('participant').insert([
{
account_id: 1,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
earliest_time: '09:30',
latest_time: '22:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 1,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
earliest_time: '09:30',
latest_time: '22:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 1,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
earliest_time: '09:30',
latest_time: '22:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 2,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
earliest_time: '09:00',
latest_time: '20:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'America/New_York',
},
{
account_id: 3,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
earliest_time: '10:30',
latest_time: '17:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Asia/Kolkata',
},
{
account_id: 4,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
earliest_time: '06:30',
latest_time: '12:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 4,
meeting_id: 'aa639e05-be03-4202-a18e-aae3bc5153f0',
earliest_time: '06:30',
latest_time: '12:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 4,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
earliest_time: '06:30',
latest_time: '12:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
earliest_time: '10:30',
latest_time: '20:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: 'a4a9b71a-91af-4e35-8377-96f56fa7f6b8',
earliest_time: '10:30',
latest_time: '20:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: '741f300a-a137-499d-b725-73770ac6fe70',
earliest_time: '10:30',
latest_time: '20:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
earliest_time: '10:30',
latest_time: '20:00',
quorum: 0,
mandatory: 0,
host: 0,
answered: 0,
timezone: 'Europe/Brussels',
},
]);
});
};

View File

@ -0,0 +1,285 @@
exports.seed = function (knex) {
// Deletes ALL existing entries
return knex('availibility')
.del()
.then(function () {
// Inserts seed entries
return knex('availibility').insert([
// Meeting 1 - Day 1
{
account_id: 1,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 1,
preference: 0,
start_time: '09:00:00',
end_time: '22:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 2,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 1,
preference: 0,
start_time: '10:00:00',
end_time: '20:00:00',
timezone: 'America/New_York',
},
// Meeting 1 - Day 2
{
account_id: 1,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 2,
preference: 0,
start_time: '10:00:00',
end_time: '14:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 2,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 2,
preference: 0,
start_time: '09:00:00',
end_time: '13:00:00',
timezone: 'America/New_York',
},
// Meeting 1 - Day 3
{
account_id: 1,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 3,
preference: 0,
start_time: '15:00:00',
end_time: '18:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 2,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 3,
preference: 0,
start_time: '14:00:00',
end_time: '20:00:00',
timezone: 'America/New_York',
},
// Meeting 1 - Day 4
{
account_id: 1,
meeting_id: '03ac7a10-316f-46e8-bb55-8611e7e5b31c',
possible_date_id: 4,
preference: 0,
start_time: '12:00:00',
end_time: '22:00:00',
timezone: 'Europe/Brussels',
},
// Meeting 2 - Day 1
{
account_id: 1,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 5,
preference: 0,
start_time: '09:00:00',
end_time: '17:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 3,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 5,
preference: 0,
start_time: '15:00:00',
end_time: '22:00:00',
timezone: 'Asia/Kolkata',
},
{
account_id: 4,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 5,
preference: 0,
start_time: '06:00:00',
end_time: '17:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 5,
preference: 0,
start_time: '06:00:00',
end_time: '10:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 5,
preference: 0,
start_time: '15:00:00',
end_time: '20:00:00',
timezone: 'Europe/Brussels',
},
// Meeting 2 - Day 2
{
account_id: 1,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 6,
preference: 0,
start_time: '15:00:00',
end_time: '21:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 3,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 6,
preference: 0,
start_time: '13:00:00',
end_time: '19:00:00',
timezone: 'Asia/Kolkata',
},
{
account_id: 4,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 6,
preference: 0,
start_time: '16:00:00',
end_time: '22:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 6,
preference: 0,
start_time: '10:00:00',
end_time: '15:00:00',
timezone: 'Europe/Brussels',
},
// Meeting 2 - Day 3
{
account_id: 1,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 7,
preference: 0,
start_time: '09:00:00',
end_time: '13:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 3,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 7,
preference: 0,
start_time: '15:00:00',
end_time: '19:00:00',
timezone: 'Asia/Kolkata',
},
{
account_id: 4,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 7,
preference: 0,
start_time: '17:00:00',
end_time: '24:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: '2e8f3748-ea5a-4d20-b9a8-683ac65f5634',
possible_date_id: 7,
preference: 0,
start_time: '20:00:00',
end_time: '23:00:00',
timezone: 'Europe/Brussels',
},
// Meeting 3 - Day 1
{
account_id: 1,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 8,
preference: 0,
start_time: '15:00:00',
end_time: '21:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 8,
preference: 0,
start_time: '09:00:00',
end_time: '13:00:00',
timezone: 'Europe/Brussels',
},
// Meeting 3 - Day 2
{
account_id: 1,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 9,
preference: 0,
start_time: '15:00:00',
end_time: '18:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 4,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 9,
preference: 0,
start_time: '09:00:00',
end_time: '14:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 9,
preference: 0,
start_time: '6:00:00',
end_time: '10:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 9,
preference: 0,
start_time: '14:00:00',
end_time: '18:00:00',
timezone: 'Europe/Brussels',
},
// Meeting 3 - Day 1
{
account_id: 1,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 10,
preference: 0,
start_time: '06:00:00',
end_time: '15:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 4,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 10,
preference: 0,
start_time: '10:00:00',
end_time: '18:00:00',
timezone: 'Europe/Brussels',
},
{
account_id: 5,
meeting_id: 'a8344a68-7961-4bff-bb3b-b288f3abcf1c',
possible_date_id: 10,
preference: 0,
start_time: '09:00:00',
end_time: '20:00:00',
timezone: 'Europe/Brussels',
},
]);
});
};