This commit is contained in:
2023-12-18 16:51:47 +01:00
commit 88741b2303
36 changed files with 1490 additions and 0 deletions

1
db/development.conf Normal file
View File

@@ -0,0 +1 @@
postgresql://svevijesti:salmonela%20pljusti%20221%20hamo@localhost:5432/svevijestiweb?ssl_mode=disabled

View File

@@ -0,0 +1 @@
DROP TABLE articles;

View File

@@ -0,0 +1,16 @@
BEGIN;
CREATE TABLE "articles" (
"id" bigint GENERATED ALWAYS AS IDENTITY,
"title" text NOT NULL UNIQUE,
"content" text NOT NULL,
"slug" text NOT NULL UNIQUE,
"created_at" timestamptz DEFAULT NOW() NOT NULL,
"original_url" text NOT NULL UNIQUE,
"source_id" int NOT NULL,
CONSTRAINT "articles_pk" PRIMARY KEY ("id")
) WITH (
OIDS=FALSE
);
COMMIT;

View File

@@ -0,0 +1,2 @@
ALTER TABLE articles
ADD CONSTRAINT articles_title_key UNIQUE (title);

View File

@@ -0,0 +1,2 @@
ALTER TABLE articles
DROP CONSTRAINT articles_title_key;