summaryrefslogtreecommitdiff
path: root/db/migrations_backup/0015_black_fixer.sql
blob: da6260c8d4efe7fb53b7d1387275829da8bacc3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/* 
    Unfortunately in current drizzle-kit version we can't automatically get name for primary key.
    We are working on making it available!

    Meanwhile you can:
        1. Check pk name in your database, by running
            SELECT constraint_name FROM information_schema.table_constraints
            WHERE table_schema = 'public'
                AND table_name = 'items'
                AND constraint_type = 'PRIMARY KEY';
        2. Uncomment code below and paste pk name manually
        
    Hope to release this update as soon as possible
*/

-- ALTER TABLE "items" DROP CONSTRAINT "<constraint_name>";--> statement-breakpoint
ALTER TABLE "items" ALTER COLUMN "item_code" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "items" ADD CONSTRAINT "items_item_code_unique" UNIQUE("item_code");