About and database table to convert for the orm
This commit is contained in:
11
database/schemas/events.sql
Normal file
11
database/schemas/events.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
CREATE EXTENSION IF NOT EXISTS pgcrypto;
|
||||
CREATE TYPE Event_status as ENUM('Canceled', 'Active')
|
||||
|
||||
CREATE TABLE events (
|
||||
event_id UUID PRIMARY KEY, -- Use UUID as the primary key
|
||||
creation_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, -- Automatically capture the creation date
|
||||
schedule_start DATE NOT NULL,
|
||||
schedule_end DATE NOT NULL,
|
||||
status Event_status DEFAULT 'Active', -- enum-like constraint for status
|
||||
CHECK (schedule_start < schedule_end) -- Ensure the start date is before the end date
|
||||
);
|
||||
Reference in New Issue
Block a user