migration.sql 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. Warnings:
  3. - You are about to drop the column `deletedAt` on the `exercise_attribute_names` table. All the data in the column will be lost.
  4. - You are about to drop the column `deletedAt` on the `exercise_attribute_values` table. All the data in the column will be lost.
  5. - You are about to drop the column `deletedAt` on the `exercise_attributes` table. All the data in the column will be lost.
  6. - You are about to drop the column `coachId` on the `exercises` table. All the data in the column will be lost.
  7. - You are about to drop the column `deletedAt` on the `exercises` table. All the data in the column will be lost.
  8. - You are about to drop the column `isArchived` on the `exercises` table. All the data in the column will be lost.
  9. - You are about to drop the column `metaDescription` on the `exercises` table. All the data in the column will be lost.
  10. - You are about to drop the column `metaDescriptionEn` on the `exercises` table. All the data in the column will be lost.
  11. - You are about to drop the column `metaTitle` on the `exercises` table. All the data in the column will be lost.
  12. - You are about to drop the column `metaTitleEn` on the `exercises` table. All the data in the column will be lost.
  13. - You are about to drop the column `privacy` on the `exercises` table. All the data in the column will be lost.
  14. - A unique constraint covering the columns `[name]` on the table `exercise_attribute_names` will be added. If there are existing duplicate values, this will fail.
  15. - Changed the type of `name` on the `exercise_attribute_names` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
  16. - Changed the type of `value` on the `exercise_attribute_values` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
  17. */
  18. -- AlterTable
  19. ALTER TABLE "exercise_attribute_names" DROP COLUMN "deletedAt",
  20. DROP COLUMN "name",
  21. ADD COLUMN "name" TEXT NOT NULL;
  22. -- AlterTable
  23. ALTER TABLE "exercise_attribute_values" DROP COLUMN "deletedAt",
  24. DROP COLUMN "value",
  25. ADD COLUMN "value" TEXT NOT NULL;
  26. -- AlterTable
  27. ALTER TABLE "exercise_attributes" DROP COLUMN "deletedAt";
  28. -- AlterTable
  29. ALTER TABLE "exercises" DROP COLUMN "coachId",
  30. DROP COLUMN "deletedAt",
  31. DROP COLUMN "isArchived",
  32. DROP COLUMN "metaDescription",
  33. DROP COLUMN "metaDescriptionEn",
  34. DROP COLUMN "metaTitle",
  35. DROP COLUMN "metaTitleEn",
  36. DROP COLUMN "privacy";
  37. -- CreateIndex
  38. CREATE UNIQUE INDEX "exercise_attribute_names_name_key" ON "exercise_attribute_names"("name");
  39. -- CreateIndex
  40. CREATE UNIQUE INDEX "exercise_attribute_values_attributeNameId_value_key" ON "exercise_attribute_values"("attributeNameId", "value");