Change migration and seeds from time to datetime

This commit is contained in:
rui hildt 2020-08-26 17:22:59 +02:00
parent ca1b0fe883
commit ad27d42144
8 changed files with 71 additions and 146 deletions

View File

@ -6,7 +6,7 @@ exports.up = (knex) => {
table.string('password').notNullable();
table.string('timezone');
table.string('earliest_time');
table.string('latest_string');
table.string('latest_time');
table.timestamps(true, true);
});
};

View File

@ -3,7 +3,7 @@ exports.up = (knex) => {
table.uuid('id').primary();
table.string('title').notNullable();
table.string('description');
table.time('start_time');
table.datetime('start_time');
table.integer('duration').notNullable();
table.boolean('status').notNullable();
table.string('password');

View File

@ -17,8 +17,8 @@ exports.up = (knex) => {
.references('possible_date.id')
.onDelete('cascade');
table.boolean('preference').notNullable();
table.time('start_time').notNullable();
table.time('end_string').notNullable();
table.datetime('start_time').notNullable();
table.datetime('end_time').notNullable();
table.timestamps(true, true);
});
};

View File

@ -12,8 +12,8 @@ exports.seed = function (knex) {
email: 'liza@example.com',
password: 'password',
timezone: 'Europe/Brussels',
earliest_time: '09:30',
latest_time: '22:00',
earliest_time: '00:00',
latest_time: '24:00',
},
{
username: 'emile',

View File

@ -10,8 +10,7 @@ exports.seed = function (knex) {
title: 'Worldwide meeting I',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '10:30',
timezone: 'Europe/Brussels',
start_time: '2025-02-19T15:00:00Z',
duration: 90,
status: 0,
password: 'simple-meeting-password',
@ -21,8 +20,7 @@ exports.seed = function (knex) {
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',
start_time: '2025-05-18T15:00:00Z',
duration: 90,
status: 0,
password: 'simple-meeting-password',
@ -32,8 +30,7 @@ exports.seed = function (knex) {
title: 'Worldwide meeting III',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '14:30',
timezone: 'Asia/Kolkata',
start_time: '2025-10-18T15:00:00Z',
duration: 90,
status: 0,
password: 'simple-meeting-password',
@ -43,8 +40,7 @@ exports.seed = function (knex) {
title: 'Worldwide meeting IV',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '19:00',
timezone: 'Asia/Sakhalin',
start_time: '2025-06-16T15:00:00Z',
duration: 90,
status: 0,
password: 'simple-meeting-password',
@ -54,8 +50,7 @@ exports.seed = function (knex) {
title: 'Worldwide meeting V',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '06:00',
timezone: 'Antarctica/DumontDUrville',
start_time: '2025-04-27T15:00:00Z',
duration: 90,
status: 0,
password: 'simple-meeting-password',
@ -65,8 +60,7 @@ exports.seed = function (knex) {
title: 'Worldwide meeting VI',
description:
"Let's find the best ethical growth hacking technics together. Yeah, fun.",
start_time: '13:30',
timezone: 'Europe/Brussels',
start_time: ' 2025-08-21T15:00:00Z',
duration: 90,
status: 0,
password: 'simple-meeting-password',

View File

@ -58,7 +58,7 @@ exports.seed = function (knex) {
},
{
meeting_id: 'aa639e05-be03-4202-a18e-aae3bc5153f0',
possible_date: '2025-06-18',
possible_date: '2025-06-16',
},
// Meeting 5

View File

@ -8,134 +8,98 @@ exports.seed = function (knex) {
{
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

@ -11,18 +11,16 @@ exports.seed = function (knex) {
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',
start_time: '2025-02-18T09:00:00Z',
end_time: '2025-02-18T22:00:00Z',
},
{
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',
start_time: '2025-02-18T10:00:00Z',
end_time: '2025-02-18T20:00:00Z',
},
// Meeting 1 - Day 2
{
@ -30,18 +28,16 @@ exports.seed = function (knex) {
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',
start_time: '2025-02-19T10:00:00Z',
end_time: '2025-02-19T14:00:00Z',
},
{
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',
start_time: '2025-02-19T09:00:00Z',
end_time: '2025-02-19T13:00:00Z',
},
// Meeting 1 - Day 3
{
@ -49,18 +45,16 @@ exports.seed = function (knex) {
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',
start_time: '2025-02-20T15:00:00Z',
end_time: '2025-02-20T18:00:00Z',
},
{
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',
start_time: '2025-02-20T14:00:00Z',
end_time: '2025-02-20T20:00:00Z',
},
// Meeting 1 - Day 4
{
@ -68,56 +62,49 @@ exports.seed = function (knex) {
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',
start_time: '2025-02-21T00:00:00Z',
end_time: '2025-02-21T22:00:00Z',
},
// 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',
start_time: '2025-05-18T09:00:00Z',
end_time: '2025-05-18T17:00:00Z',
},
{
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',
start_time: '2025-05-18T15:00:00Z',
end_time: '2025-05-18T22:00:00Z',
},
{
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',
start_time: '2025-05-18T06:00:00Z',
end_time: '2025-05-18T17:00:00Z',
},
{
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',
start_time: '2025-05-18T06:00:00Z',
end_time: '2025-05-18T22:00:00Z',
},
{
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',
start_time: '2025-05-18T15:00:00Z',
end_time: '2025-05-18T20:00:00Z',
},
// Meeting 2 - Day 2
{
@ -125,36 +112,32 @@ exports.seed = function (knex) {
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',
start_time: '2025-05-19T15:00:00Z',
end_time: '2025-05-19T21:00:00Z',
},
{
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',
start_time: '2025-05-19T13:00:00Z',
end_time: '2025-05-19T19:00:00Z',
},
{
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',
start_time: '2025-05-19T16:00:00Z',
end_time: '2025-05-19T22:00:00Z',
},
{
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',
start_time: '2025-05-19T10:00:00Z',
end_time: '2025-05-19T15:00:00Z',
},
// Meeting 2 - Day 3
{
@ -162,123 +145,107 @@ exports.seed = function (knex) {
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',
start_time: '2025-05-22T09:00:00Z',
end_time: '2025-05-22T13:00:00Z',
},
{
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',
start_time: '2025-05-22T15:00:00Z',
end_time: '2025-05-22T19:00:00Z',
},
{
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',
start_time: '2025-05-22T17:00:00Z',
end_time: '2025-05-22T12:00:00Z',
},
{
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',
start_time: '2025-05-22T20:00:00Z',
end_time: '2025-05-22T23:00:00Z',
},
// 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',
start_time: '2025-08-18T15:00:00Z',
end_time: '2025-08-18T21:00:00Z',
},
{
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',
start_time: '2025-08-18T09:00:00Z',
end_time: '2025-08-18T13:00:00Z',
},
// 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',
start_time: '2025-10-18T15:00:00Z',
end_time: '2025-10-18T18:00:00Z',
},
{
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',
start_time: '2025-10-18T09:00:00Z',
end_time: '2025-10-18T14:00:00Z',
},
{
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',
start_time: '2025-10-18T06:00:00Z',
end_time: '2025-10-18T10:00:00Z',
},
{
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',
start_time: '2025-10-18T14:00:00Z',
end_time: '2025-10-18T18:00:00Z',
},
// Meeting 3 - Day 3
{
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',
start_time: '2025-12-18T06:00:00Z',
end_time: '2025-12-18T15:00:00Z',
},
{
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',
start_time: '2025-12-18T10:00:00Z',
end_time: '2025-12-18T18:00:00Z',
},
{
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',
start_time: '2025-12-18T09:00:00Z',
end_time: '2025-12-18T20:00:00Z',
},
]);
});