From 01be674eb834126ede62f0ba263c03ce02d1718d Mon Sep 17 00:00:00 2001 From: Anastasiya Trusova <129950255+NastasiyaT@users.noreply.github.com> Date: Sun, 22 Oct 2023 10:52:28 +0300 Subject: [PATCH] Update schema.sql --- app/src/main/resources/schema.sql | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/resources/schema.sql b/app/src/main/resources/schema.sql index db3a13f..227ae49 100644 --- a/app/src/main/resources/schema.sql +++ b/app/src/main/resources/schema.sql @@ -1,18 +1,20 @@ DROP TABLE IF EXISTS urls CASCADE; CREATE TABLE urls ( - id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY, + id SERIAL, name VARCHAR(255) NOT NULL, - created_at TIMESTAMP NOT NULL + created_at TIMESTAMP NOT NULL, + CONSTRAINT pk_urls PRIMARY KEY (id) ); DROP TABLE IF EXISTS url_checks; CREATE TABLE url_checks ( - id BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY, + id SERIAL, url_id BIGINT REFERENCES urls (id) NOT NULL, status_code BIGINT, h1 VARCHAR(255), title VARCHAR(255), description TEXT, - created_at TIMESTAMP NOT NULL + created_at TIMESTAMP NOT NULL, + CONSTRAINT pk_url_checks PRIMARY KEY (id) )