Guest User

Untitled

a guest
Mar 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. CREATE USER username WITH PASSWORD 'password';
  2.  
  3. CREATE DATABASE database;
  4.  
  5. GRANT ALL PRIVILEGES ON DATABASE database to username;
  6.  
  7. CREATE TABLE IF NOT EXISTS USERS (
  8. id SERIAL PRIMARY KEY,
  9. name TEXT NOT NULL,
  10. created_at DATE NOT NULL,
  11. updated_at DATE NOT NULL
  12.  
  13.  
  14. CREATE TABLE IF NOT EXISTS POSTS (
  15. id SERIAL PRIMARY KEY,
  16. created_at DATE NOT NULL,
  17. updated_at DATE NOT NULL,
  18. users_id INT references USERS(id)
  19. );
Add Comment
Please, Sign In to add comment