diff --git a/postgres/init.sql b/postgres/init.sql index 9a55aa3..044b3c2 100644 --- a/postgres/init.sql +++ b/postgres/init.sql @@ -2,9 +2,17 @@ CREATE TABLE user_account ( id uuid UNIQUE NOT NULL DEFAULT uuidv7(), full_name text NOT NULL, password_hash text NOT NULL, - email text UNIQUE NOT NULL, + email text UNIQUE NOT NULL CHECK (email LIKE '%@%'), created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, is_active boolean NOT NULL DEFAULT TRUE, - PRIMARY KEY (id), - CONSTRAINT valid_email_format CHECK (email LIKE '%@%') + PRIMARY KEY (id) +); + +CREATE TABLE startup ( + id uuid UNIQUE NOT NULL DEFAULT uuidv7(), + cnpj text UNIQUE NOT NULL CHECK (length(cnpj) = 14), + description text, + city text NOT NULL, + state text NOT NULL, + PRIMARY KEY (id) );