Advertisement
Guest User

Untitled

a guest
May 4th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. DROP TABLE IF EXISTS link;
  2. DROP TABLE IF EXISTS article;
  3. DROP TYPE IF EXISTS article_status;
  4.  
  5. CREATE TYPE article_status AS ENUM ('Created', 'Pending', 'Published', 'Rejected');
  6.  
  7. CREATE TABLE article (
  8. id serial UNIQUE NOT NULL,
  9. total_air_time INTEGER default 0,
  10. expire_date timestamp,
  11. article_type VARCHAR(50),
  12. cathegory VARCHAR(50),
  13. subject VARCHAR(100),
  14. content_article VARCHAR(1000),
  15. status VARCHAR(100),
  16. author VARCHAR(30),
  17. PRIMARY KEY (id)
  18. );
  19.  
  20. CREATE TABLE link(
  21. id serial UNIQUE NOT NULL,
  22. article_id INTEGER references article(id),
  23. link VARCHAR(500),
  24. PRIMARY KEY(id)
  25.  
  26. );
  27.  
  28. INSERT INTO article VALUES (2, 13, '2016-01-09 04:05:06', 'ARTICLE', 'Congratulations', 'Congrats!', 'Congrats to Sergiu for passing the ISTQB - BCS Certified Tester Foundation Level Certification', 'PUBLISHED', 'Ioana Pavel');
  29. INSERT INTO article VALUES (1, 12, '2016-01-08 04:05:06', 'ARTICLE', 'Information', 'Happy Easter!', 'We hope you will enjoy the sweet surprises on your desks this morning! This is to mark the beginning of the holidays and to get in the mood of celebration, as well as a sign of appreciation!', 'CREATED', 'Ioana Pavel');
  30. INSERT INTO article VALUES (3, 33, '2016-12-29 12:12:00', 'FILE', 'Information', 'Books', 'Our 5 Voices book order has just arrived in the office and you can find the books in the library starting this morning. Go grab one and make the most out of it; it will change the way you lead and communicate with your teams, colleagues and family.', 'REJECTED', 'Marina');
  31. INSERT INTO article VALUES (4, 11, '2016-12-10 11:11:11', 'FILE', 'Welcome', 'Welcome!', 'Madalina Enache joined Endava in the position of Tester and is working in the WorldPay project/P&MS team located in Palas. Madalina has two and a half years of experience in manual testing within MIND Software. Her experience is enhanced by her Bachelor’s Degree in Computer Science. ', 'PENDING', 'Marina');
  32.  
  33. INSERT INTO link VALUES (1,1, 'link1');
  34. INSERT INTO link VALUES (2,2, 'link2');
  35. INSERT INTO link VALUES (3,3, 'link3');
  36. INSERT INTO link VALUES (4,2, 'link4');
  37. INSERT INTO link VALUES (5,1, 'link5');
  38.  
  39.  
  40. select * from article;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement