Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions multifile/tables/orders.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
CREATE TABLE IF NOT EXISTS orders (
id integer PRIMARY KEY,
user_id integer NOT NULL REFERENCES users(id),
status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed')),
amount numeric(10,2) DEFAULT 0.00
status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed'))
);

COMMENT ON TABLE orders IS 'Customer orders';
Expand Down
3 changes: 2 additions & 1 deletion multifile/tables/users.sql
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
CREATE TABLE IF NOT EXISTS users (
id integer PRIMARY KEY,
email text NOT NULL CHECK (email LIKE '%@%'),
name text NOT NULL
name text NOT NULL,
age integer CHECK (age >= 0)
);

COMMENT ON TABLE users IS 'User accounts';
Expand Down
Loading