ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
821 B

  1. import * as Sequelize from 'sequelize'
  2. async function up (utils: {
  3. transaction: Sequelize.Transaction
  4. queryInterface: Sequelize.QueryInterface
  5. sequelize: Sequelize.Sequelize
  6. }): Promise<void> {
  7. const { transaction } = utils
  8. {
  9. await utils.sequelize.query('DELETE FROM "userNotification" WHERE type = 20 AND "userRegistrationId" IS NULL', { transaction })
  10. }
  11. {
  12. await utils.sequelize.query(
  13. 'ALTER TABLE "userNotification" DROP CONSTRAINT "userNotification_userRegistrationId_fkey", ' +
  14. 'ADD CONSTRAINT "userNotification_userRegistrationId_fkey" ' +
  15. 'FOREIGN KEY ("userRegistrationId") REFERENCES "userRegistration" ("id") ON DELETE CASCADE ON UPDATE CASCADE',
  16. { transaction })
  17. }
  18. }
  19. function down (options) {
  20. throw new Error('Not implemented.')
  21. }
  22. export {
  23. up,
  24. down
  25. }