Skip to content

Commit a30b8ac

Browse files
committed
feat: single-file-example schema change
1 parent 7a97462 commit a30b8ac

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

singlefile/schema.sql

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,12 @@ $$;
7171
CREATE TABLE IF NOT EXISTS users (
7272
id integer PRIMARY KEY,
7373
email text NOT NULL CHECK (email LIKE '%@%'),
74-
name text NOT NULL
74+
name text NOT NULL,
75+
age integer CHECK (age >= 0)
7576
);
7677

7778
COMMENT ON TABLE users IS 'User accounts';
7879

79-
COMMENT ON COLUMN users.email IS 'User email address';
80-
8180
--
8281
-- Name: idx_users_email; Type: INDEX; Schema: -; Owner: -
8382
--
@@ -117,7 +116,6 @@ CREATE OR REPLACE TRIGGER users_update_trigger
117116
CREATE TABLE IF NOT EXISTS orders (
118117
id integer PRIMARY KEY,
119118
user_id integer NOT NULL REFERENCES users(id),
120-
status text DEFAULT 'pending' NOT NULL CHECK (status IN ('pending', 'completed')),
121119
amount numeric(10,2) DEFAULT 0.00
122120
);
123121

0 commit comments

Comments
 (0)