crablog/migrations/2018-10-10-135830_link post and user/up.sql
2018-10-23 14:18:56 +08:00

8 lines
279 B
SQL

-- Your SQL goes here
ALTER TABLE "public"."articles"
ADD COLUMN "user_id" integer DEFAULT '1' NOT NULL,
ADD COLUMN "publish_at" timestamp without time zone NOT NULL,
ADD COLUMN "url" text,
ADD CONSTRAINT "user_id" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id");