Schema.sql uncommenting to attempt to fix breaking build

This commit is contained in:
Kruti Shah 2026-01-13 00:37:15 +05:30
parent e2b2cc3ead
commit 6047471ff8

View File

@ -1,29 +1,29 @@
--CREATE EXTENSION IF NOT EXISTS "pgcrypto";
--
--CREATE TABLE IF NOT EXISTS tunnels (
-- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- environment VARCHAR(10) NOT NULL,
-- cf_tunnel_id UUID UNIQUE NOT NULL
--);
--
--CREATE TABLE IF NOT EXISTS users (
-- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- name VARCHAR(50) NOT NULL
--);
--
--CREATE TABLE IF NOT EXISTS mappings (
-- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- tunnel_id UUID NOT NULL REFERENCES tunnels(id) ON DELETE CASCADE,
-- port INT NOT NULL,
-- subdomain VARCHAR(50) NOT NULL
---- UNIQUE (tunnel_id, port),
---- UNIQUE (tunnel_id, subdomain)
--);
--
--CREATE TABLE IF NOT EXISTS requests (
-- id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
-- mapping_id UUID NOT NULL REFERENCES mappings(id) ON DELETE CASCADE,
-- created_by UUID NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
-- accepted_by UUID REFERENCES users(id) ON DELETE SET NULL,
-- status VARCHAR(20) NOT NULL CHECK (status IN ('PENDING', 'APPROVED', 'REJECTED'))
--);
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
CREATE TABLE IF NOT EXISTS tunnels (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
environment VARCHAR(10) NOT NULL,
cf_tunnel_id UUID UNIQUE NOT NULL
);
CREATE TABLE IF NOT EXISTS users (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
name VARCHAR(50) NOT NULL
);
CREATE TABLE IF NOT EXISTS mappings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
tunnel_id UUID NOT NULL REFERENCES tunnels(id) ON DELETE CASCADE,
port INT NOT NULL,
subdomain VARCHAR(50) NOT NULL
-- UNIQUE (tunnel_id, port),
-- UNIQUE (tunnel_id, subdomain)
);
CREATE TABLE IF NOT EXISTS requests (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
mapping_id UUID NOT NULL REFERENCES mappings(id) ON DELETE CASCADE,
created_by UUID NOT NULL REFERENCES users(id) ON DELETE RESTRICT,
accepted_by UUID REFERENCES users(id) ON DELETE SET NULL,
status VARCHAR(20) NOT NULL CHECK (status IN ('PENDING', 'APPROVED', 'REJECTED'))
);