diff --git a/server/migrations/20231015153412_subscription_plans.js b/server/migrations/20231015153412_subscription_plans.js deleted file mode 100644 index 5549174a..00000000 --- a/server/migrations/20231015153412_subscription_plans.js +++ /dev/null @@ -1,21 +0,0 @@ -exports.up = function (knex) { - return knex.schema - .createTableIfNotExists('subscription_plans', (table) => { - table.increments('id').primary(); - table.string('name').notNullable(); - table.float('price').notNullable(); - table.string('radius').notNullable(); - table.integer('alerts_qty').notNullable(); - table.string('type').notNullable(); - }) - .catch((error) => { - console.error( - 'Subscription plans table already exists, error is:', - error - ); - }); -}; - -exports.down = async function (knex) { - await knex.schema.dropTableIfExists('subscription_plans'); -}; diff --git a/server/migrations/20231020133632_person_subscribe_plan_id.js b/server/migrations/20231020133632_person_subscribe_plan_id.js index 43d179c6..8f1ec2a0 100644 --- a/server/migrations/20231020133632_person_subscribe_plan_id.js +++ b/server/migrations/20231020133632_person_subscribe_plan_id.js @@ -1,11 +1,15 @@ exports.up = function (knex) { return knex.schema.table('person', (table) => { table.integer('subscribe_plan_id'); + table.boolean('is_reached_max_alerts'); + table.boolean('is_subscription_canceled'); }); }; exports.down = function (knex) { return knex.schema.table('person', (table) => { table.dropColumns('subscribe_plan_id'); + table.dropColumns('is_reached_max_alerts'); + table.dropColumns('is_subscription_canceled'); }); }; diff --git a/server/migrations/20231021142202_is_reached_max_alerts.js b/server/migrations/20231021142202_is_reached_max_alerts.js deleted file mode 100644 index 2aed91e8..00000000 --- a/server/migrations/20231021142202_is_reached_max_alerts.js +++ /dev/null @@ -1,11 +0,0 @@ -exports.up = function (knex) { - return knex.schema.table('person', (table) => { - table.boolean('is_reached_max_alerts'); - }); -}; - -exports.down = function (knex) { - return knex.schema.table('person', (table) => { - table.dropColumns('is_reached_max_alerts'); - }); -}; diff --git a/server/migrations/20231104163221_is_subscription_canceled.js b/server/migrations/20231104163221_is_subscription_canceled.js deleted file mode 100644 index e2d0c5aa..00000000 --- a/server/migrations/20231104163221_is_subscription_canceled.js +++ /dev/null @@ -1,11 +0,0 @@ -exports.up = function (knex) { - return knex.schema.table('person', table => { - table.boolean('is_subscription_canceled'); - }); -}; - -exports.down = function (knex) { - return knex.schema.table('person', table => { - table.dropColumns('is_subscription_canceled'); - }); -}; diff --git a/server/migrations/20231105213356_scheduled_tasks.js b/server/migrations/20231105213356_scheduled_tasks.js index ca1a56d0..5deadd80 100644 --- a/server/migrations/20231105213356_scheduled_tasks.js +++ b/server/migrations/20231105213356_scheduled_tasks.js @@ -1,12 +1,12 @@ exports.up = function (knex) { - return knex.schema.createTable('scheduled_tasks', table => { - table.increments('id').primary(); - table.integer('person_id'); - table.integer('subscription_id'); - table.string('date'); - }); + return knex.schema.createTable('scheduled_tasks', table => { + table.increments('id').primary(); + table.integer('person_id'); + table.integer('subscription_id'); + table.string('date'); + }); }; exports.down = function (knex) { - return knex.schema.dropTable('scheduled_tasks'); + return knex.schema.dropTable('scheduled_tasks'); };