Skip to content

Commit 243bf8c

Browse files
authored
Update current.sql with an example table
Would love to have an example table in the `current.sql` to show how powerful this setup really is. The intention here is to show the `graphile-migrate` in action for the new users.
1 parent 6580e97 commit 243bf8c

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

@app/db/migrations/current.sql

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
11
-- Enter migration here
2+
3+
/*
4+
example of a table that could be created after setup complete
5+
6+
- uncomment the statements below
7+
- save the file and graphile-migrate will update the schema into database automagically
8+
*/
9+
10+
-- CREATE TYPE app_public.post_topic AS enum (
11+
-- 'discussion',
12+
-- 'inspiration',
13+
-- 'help',
14+
-- 'showcase'
15+
-- );
16+
17+
-- CREATE TABLE IF NOT EXISTS app_public.post (
18+
-- id SERIAL PRIMARY KEY,
19+
-- author_id INTEGER NOT NULL REFERENCES app_public.users(id),
20+
-- headline TEXT NOT NULL CHECK (char_length(headline) < 280),
21+
-- body TEXT,
22+
-- topic app_public.post_topic,
23+
-- created_at TIMESTAMP default NOW()
24+
-- );
25+
26+
-- COMMENT ON TABLE APP_PUBLIC.POST IS 'A forum post written by a user.';
27+
-- COMMENT ON COLUMN APP_PUBLIC.POST.ID IS 'The primary key for the post.';
28+
-- COMMENT ON COLUMN APP_PUBLIC.POST.HEADLINE IS 'The title written by the user.';
29+
-- COMMENT ON COLUMN APP_PUBLIC.POST.AUTHOR_ID IS 'The id of the author user.';
30+
-- COMMENT ON COLUMN APP_PUBLIC.POST.TOPIC IS 'The topic this has been posted in.';
31+
-- COMMENT ON COLUMN APP_PUBLIC.POST.BODY IS 'The main body text of our post.';
32+
-- COMMENT ON COLUMN APP_PUBLIC.POST.CREATED_AT IS 'The time this post was created.';

0 commit comments

Comments
 (0)