up.sql 291 B

1234567891011
  1. -- Your SQL goes here
  2. CREATE TABLE groups_users (
  3. id SERIAL PRIMARY KEY,
  4. group_id INTEGER NOT NULL,
  5. user_id INTEGER NOT NULL,
  6. created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
  7. );
  8. CREATE UNIQUE INDEX group_user_id ON groups_users (group_id,user_id);