From 4e43d3be66a48680460fc2aa4a2c1a42e9acd912 Mon Sep 17 00:00:00 2001 From: Eden Kirin Date: Thu, 14 Sep 2023 20:00:35 +0200 Subject: [PATCH] Update migrations --- migrations/0001-initial.sql | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/migrations/0001-initial.sql b/migrations/0001-initial.sql index afb47f4..c2b17fc 100644 --- a/migrations/0001-initial.sql +++ b/migrations/0001-initial.sql @@ -1,10 +1,11 @@ CREATE TABLE cities ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - name varchar(50) NOT NULL, - postal_code varchar(10), - created_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL, - modified_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL + id uuid DEFAULT gen_random_uuid() NOT NULL, + name varchar(50) NOT NULL, + postal_code varchar(10), + created_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL, + updated_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL, + sa_orm_sentinel uuid ); CREATE UNIQUE INDEX cities_id_uindex @@ -12,15 +13,17 @@ CREATE UNIQUE INDEX cities_id_uindex CREATE TABLE users ( - id uuid DEFAULT gen_random_uuid() NOT NULL, - first_name varchar(50), - last_name varchar(50), - city_id uuid + id uuid DEFAULT gen_random_uuid() NOT NULL, + first_name varchar(50), + last_name varchar(50), + city_id uuid CONSTRAINT users_cities_id_fk REFERENCES cities (), - created_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL, - modified_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL + created_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL, + updated_at timestamp WITH TIME ZONE DEFAULT NOW() NOT NULL, + sa_orm_sentinel uuid ); CREATE UNIQUE INDEX users_id_uindex ON users (id); +