From d141681f0116dd902048b02c18e1a63eb31f4c69 Mon Sep 17 00:00:00 2001 From: Sandu Victor Date: Sat, 11 Jul 2020 23:07:03 +0300 Subject: [PATCH] feat: added country column in users table --- .../20200711211052_create_country_column.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 packages/api/db/migrations/20200711211052_create_country_column.ts diff --git a/packages/api/db/migrations/20200711211052_create_country_column.ts b/packages/api/db/migrations/20200711211052_create_country_column.ts new file mode 100644 index 0000000..56375e0 --- /dev/null +++ b/packages/api/db/migrations/20200711211052_create_country_column.ts @@ -0,0 +1,16 @@ +import Knex from "knex"; + +export const up = async (knex: Knex) => { + return knex.schema.table("users", table => { + table + .string("country") + .notNullable() + .defaultTo(""); + }); +}; + +export const down = async (knex: Knex) => { + return knex.schema.table("users", table => { + return table.dropColumn("country"); + }); +};