We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents fa63232 + dcc5d3a commit af13984Copy full SHA for af13984
1 file changed
singlefile/schema.sql
@@ -71,7 +71,8 @@ $$;
71
CREATE TABLE IF NOT EXISTS users (
72
id integer PRIMARY KEY,
73
email text NOT NULL CHECK (email LIKE '%@%'),
74
- name text NOT NULL
+ name text NOT NULL,
75
+ age integer CHECK (age >= 0)
76
);
77
78
COMMENT ON TABLE users IS 'User accounts';
@@ -117,8 +118,7 @@ CREATE OR REPLACE TRIGGER users_update_trigger
117
118
CREATE TABLE IF NOT EXISTS orders (
119
120
user_id integer NOT NULL REFERENCES users(id),
- status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed')),
121
- amount numeric(10,2) DEFAULT 0.00
+ status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed'))
122
123
124
COMMENT ON TABLE orders IS 'Customer orders';
0 commit comments