/*
  Warnings:

  - The values [Maintanance,Repair,Broken] on the enum `hostel_status_type` will be removed. If these variants are still used in the database, this will fail.
  - You are about to drop the column `block_number` on the `hostel_block` table. All the data in the column will be lost.
  - You are about to drop the column `building_number` on the `hostel_building` table. All the data in the column will be lost.
  - You are about to drop the column `floor_number` on the `hostel_floor` table. All the data in the column will be lost.
  - You are about to drop the column `room_number` on the `hostel_room` table. All the data in the column will be lost.
  - Added the required column `order` to the `hostel_floor` table without a default value. This is not possible if the table is not empty.
  - Added the required column `order` to the `hostel_room` table without a default value. This is not possible if the table is not empty.
  - Added the required column `regional_training_center_id` to the `officer` table without a default value. This is not possible if the table is not empty.

*/
-- AlterEnum
BEGIN;
CREATE TYPE "hostel_status_type_new" AS ENUM ('UnderMaintenance', 'Unusable', 'Active');
ALTER TABLE "hostel_building" ALTER COLUMN "status" TYPE "hostel_status_type_new" USING ("status"::text::"hostel_status_type_new");
ALTER TABLE "hostel_block" ALTER COLUMN "status" TYPE "hostel_status_type_new" USING ("status"::text::"hostel_status_type_new");
ALTER TABLE "hostel_floor" ALTER COLUMN "status" TYPE "hostel_status_type_new" USING ("status"::text::"hostel_status_type_new");
ALTER TABLE "hostel_room" ALTER COLUMN "status" TYPE "hostel_status_type_new" USING ("status"::text::"hostel_status_type_new");
ALTER TABLE "hostel_bed" ALTER COLUMN "status" TYPE "hostel_status_type_new" USING ("status"::text::"hostel_status_type_new");
ALTER TYPE "hostel_status_type" RENAME TO "hostel_status_type_old";
ALTER TYPE "hostel_status_type_new" RENAME TO "hostel_status_type";
DROP TYPE "hostel_status_type_old";
COMMIT;

-- AlterTable
ALTER TABLE "course_director" ADD COLUMN     "short_code" TEXT NOT NULL DEFAULT E'';

-- AlterTable
ALTER TABLE "hostel_bed" ALTER COLUMN "status" SET DEFAULT E'Active';

-- AlterTable
ALTER TABLE "hostel_block" DROP COLUMN "block_number",
ADD COLUMN     "order" INTEGER NOT NULL DEFAULT 0,
ALTER COLUMN "status" SET DEFAULT E'Active';

-- AlterTable
ALTER TABLE "hostel_building" DROP COLUMN "building_number",
ADD COLUMN     "order" INTEGER NOT NULL DEFAULT 0,
ALTER COLUMN "status" SET DEFAULT E'Active';

-- AlterTable
ALTER TABLE "hostel_floor" DROP COLUMN "floor_number",
ADD COLUMN     "order" TEXT NOT NULL,
ALTER COLUMN "status" SET DEFAULT E'Active';

-- AlterTable
ALTER TABLE "hostel_room" DROP COLUMN "room_number",
ADD COLUMN     "order" TEXT NOT NULL,
ALTER COLUMN "status" SET DEFAULT E'Active';

-- AlterTable
ALTER TABLE "officer" ADD COLUMN     "regional_training_center_id" TEXT NOT NULL;

-- AddForeignKey
ALTER TABLE "officer" ADD FOREIGN KEY ("regional_training_center_id") REFERENCES "regional_training_center"("id") ON DELETE CASCADE ON UPDATE CASCADE;
