-- AlterTable
ALTER TABLE `issued_orders` ADD COLUMN `locked_at` DATETIME(0) NULL,
    ADD COLUMN `locked_by` INTEGER NULL;

-- CreateTable
CREATE TABLE `issued_order_sections` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `issued_order_id` INTEGER NOT NULL,
    `position` INTEGER NULL DEFAULT 0,
    `title` VARCHAR(500) NULL,
    `title_cz` VARCHAR(500) NULL,
    `content` TEXT NULL,
    `modified_at` DATETIME(0) NULL,

    INDEX `issued_order_sections_order_id`(`issued_order_id`),
    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `issued_order_sections` ADD CONSTRAINT `issued_order_sections_fk` FOREIGN KEY (`issued_order_id`) REFERENCES `issued_orders`(`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

