0650-actor-custom-pages.ts 741 B

123456789101112131415161718192021222324252627282930313233
  1. import * as Sequelize from 'sequelize'
  2. async function up (utils: {
  3. transaction: Sequelize.Transaction
  4. queryInterface: Sequelize.QueryInterface
  5. sequelize: Sequelize.Sequelize
  6. db: any
  7. }): Promise<void> {
  8. {
  9. const query = `
  10. CREATE TABLE IF NOT EXISTS "actorCustomPage" (
  11. "id" serial,
  12. "content" TEXT,
  13. "type" varchar(255) NOT NULL,
  14. "actorId" integer NOT NULL REFERENCES "actor" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
  15. "createdAt" timestamp WITH time zone NOT NULL,
  16. "updatedAt" timestamp WITH time zone NOT NULL,
  17. PRIMARY KEY ("id")
  18. );
  19. `
  20. await utils.sequelize.query(query)
  21. }
  22. }
  23. function down (options) {
  24. throw new Error('Not implemented.')
  25. }
  26. export {
  27. up,
  28. down
  29. }