Migrations - uuid fix

This commit is contained in:
PB
2025-11-08 19:24:12 +01:00
parent 3907be917d
commit d5596b59cb
6 changed files with 17 additions and 8 deletions

View File

@@ -1,3 +1,5 @@
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE IF NOT EXISTS basket.basket CREATE TABLE IF NOT EXISTS basket.basket
( (
id uuid NOT NULL DEFAULT gen_random_uuid(), id uuid NOT NULL DEFAULT gen_random_uuid(),

View File

@@ -1,11 +1,13 @@
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE catalog.product CREATE TABLE catalog.product
( (
id uuid NOT NULL DEFAULT uuid_generate_v4(), id uuid NOT NULL DEFAULT gen_random_uuid(),
"name" character varying NOT NULL, "name" character varying NOT NULL,
slug character varying NOT NULL, slug character varying NOT NULL,
price double precision NOT NULL, price double precision NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT now(), created_at timestamp with time zone NOT NULL DEFAULT now(),
updated_at timestamp without time zone, updated_at timestamp with time zone,
PRIMARY KEY (id) PRIMARY KEY (id)
); );

View File

@@ -1,6 +1,8 @@
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE IF NOT EXISTS identity.users CREATE TABLE IF NOT EXISTS identity.users
( (
id uuid NOT NULL DEFAULT uuid_generate_v4(), id uuid NOT NULL DEFAULT gen_random_uuid(),
username character varying NOT NULL, username character varying NOT NULL,
"password" character varying NOT NULL, "password" character varying NOT NULL,
email character varying NOT NULL, email character varying NOT NULL,
@@ -13,7 +15,7 @@ CREATE TABLE IF NOT EXISTS identity.users
CREATE TABLE IF NOT EXISTS identity.roles CREATE TABLE IF NOT EXISTS identity.roles
( (
id uuid NOT NULL DEFAULT uuid_generate_v4(), id uuid NOT NULL DEFAULT gen_random_uuid(),
name character varying(100) COLLATE pg_catalog."default" NOT NULL, name character varying(100) COLLATE pg_catalog."default" NOT NULL,
display_name character varying(200) COLLATE pg_catalog."default" NOT NULL, display_name character varying(200) COLLATE pg_catalog."default" NOT NULL,
created_at timestamp without time zone NOT NULL DEFAULT now(), created_at timestamp without time zone NOT NULL DEFAULT now(),
@@ -23,7 +25,7 @@ CREATE TABLE IF NOT EXISTS identity.roles
CREATE TABLE IF NOT EXISTS identity.users_roles CREATE TABLE IF NOT EXISTS identity.users_roles
( (
id uuid NOT NULL DEFAULT uuid_generate_v4(), id uuid NOT NULL DEFAULT gen_random_uuid(),
user_id uuid NOT NULL, user_id uuid NOT NULL,
role_id uuid NOT NULL, role_id uuid NOT NULL,
PRIMARY KEY (id), PRIMARY KEY (id),
@@ -42,7 +44,7 @@ CREATE TABLE IF NOT EXISTS identity.users_roles
CREATE TABLE identity.url_access CREATE TABLE identity.url_access
( (
id uuid NOT NULL DEFAULT uuid_generate_v4(), id uuid NOT NULL DEFAULT gen_random_uuid(),
roles json NOT NULL, roles json NOT NULL,
url character varying(255) NOT NULL, url character varying(255) NOT NULL,
method character varying(10) NOT NULL, method character varying(10) NOT NULL,

View File

@@ -4,7 +4,6 @@ CREATE DATABASE egommerce;
GRANT ALL PRIVILEGES ON DATABASE egommerce TO egommerce; GRANT ALL PRIVILEGES ON DATABASE egommerce TO egommerce;
CREATE EXTENSION IF NOT EXISTS "pgcrypto"; CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE SCHEMA "identity" AUTHORIZATION egommerce; CREATE SCHEMA "identity" AUTHORIZATION egommerce;
CREATE SCHEMA catalog AUTHORIZATION egommerce; CREATE SCHEMA catalog AUTHORIZATION egommerce;

View File

@@ -1,3 +1,5 @@
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE IF NOT EXISTS "ordering"."order" CREATE TABLE IF NOT EXISTS "ordering"."order"
( (
id uuid NOT NULL DEFAULT gen_random_uuid(), id uuid NOT NULL DEFAULT gen_random_uuid(),

View File

@@ -1,3 +1,5 @@
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE IF NOT EXISTS pricing."price" CREATE TABLE IF NOT EXISTS pricing."price"
( (
id uuid NOT NULL DEFAULT gen_random_uuid() id uuid NOT NULL DEFAULT gen_random_uuid()