Advertisement
kardapoltsev

Untitled

Jun 25th, 2014
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.81 KB | None | 0 0
  1. DROP TYPE IF EXISTS freedom_rep_spec_description_type;
  2. CREATE TYPE freedom_rep_spec_description_type AS enum
  3. (
  4.   'SponsorFee', 'LeaderFee'
  5. );
  6. ALTER TYPE freedom_rep_spec_description_type owner TO sunrise;
  7.  
  8.  
  9. DROP TABLE IF EXISTS freedom_rep_spec_descriptions;
  10. CREATE TABLE freedom_rep_spec_descriptions
  11. (
  12.   report_id INTEGER NOT NULL REFERENCES freedom_rep(id),
  13.   recever_id INTEGER NOT NULL REFERENCES accounts(id),
  14.   account_id INTEGER NOT NULL REFERENCES accounts(id),
  15.   amount BIGINT NOT NULL,
  16.   TYPE freedom_rep_spec_description_type NOT NULL
  17. );
  18. ALTER TABLE freedom_rep_spec_descriptions owner TO sunrise;
  19. GRANT ALL ON TABLE freedom_rep_spec_descriptions TO sunrise;
  20. GRANT ALL ON TABLE freedom_rep_spec_descriptions TO sunrise_admin;
  21. GRANT SELECT, INSERT ON TABLE freedom_rep_spec_descriptions TO wui;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement