migration.sql 744 B

1234567891011121314151617
  1. -- DropForeignKey
  2. ALTER TABLE `comment` DROP FOREIGN KEY `comment_authorId_fkey`;
  3. -- DropForeignKey
  4. ALTER TABLE `post` DROP FOREIGN KEY `post_authorId_fkey`;
  5. -- DropForeignKey
  6. ALTER TABLE `userinfo` DROP FOREIGN KEY `userinfo_authId_fkey`;
  7. -- AddForeignKey
  8. ALTER TABLE `post` ADD CONSTRAINT `post_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `auth`(`auth_id`) ON DELETE CASCADE ON UPDATE CASCADE;
  9. -- AddForeignKey
  10. ALTER TABLE `comment` ADD CONSTRAINT `comment_authorId_fkey` FOREIGN KEY (`authorId`) REFERENCES `auth`(`auth_id`) ON DELETE CASCADE ON UPDATE CASCADE;
  11. -- AddForeignKey
  12. ALTER TABLE `userinfo` ADD CONSTRAINT `userinfo_authId_fkey` FOREIGN KEY (`authId`) REFERENCES `auth`(`auth_id`) ON DELETE CASCADE ON UPDATE CASCADE;