/*
  Warnings:

  - You are about to alter the column `ir` on the `invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,0)` to `Decimal`.
  - You are about to alter the column `cofins` on the `invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,0)` to `Decimal`.
  - You are about to alter the column `pis` on the `invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,0)` to `Decimal`.
  - You are about to alter the column `csll` on the `invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,0)` to `Decimal`.
  - You are about to alter the column `iss` on the `invoices` table. The data in that column could be lost. The data in that column will be cast from `Decimal(10,0)` to `Decimal`.

*/
-- AlterTable
ALTER TABLE `balances` MODIFY `type` ENUM('ADMINISTRATIVE_FEE', 'TAXES', 'BANK_FEE', 'PAYMENT_APPROVED', 'TRANSFER', 'REVERSAL', 'ISOLATED') NOT NULL DEFAULT 'ISOLATED';

-- AlterTable
ALTER TABLE `invoices` MODIFY `ir` DECIMAL NOT NULL,
    MODIFY `cofins` DECIMAL NOT NULL,
    MODIFY `pis` DECIMAL NOT NULL,
    MODIFY `csll` DECIMAL NOT NULL,
    MODIFY `iss` DECIMAL NOT NULL;

-- CreateTable
CREATE TABLE `service_takers_council_details` (
    `id` INTEGER NOT NULL AUTO_INCREMENT,
    `created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
    `updated_at` DATETIME(3) NOT NULL,
    `technical_manager` VARCHAR(191) NOT NULL,
    `register_date` DATE NOT NULL,
    `expiration_date` DATE NOT NULL,
    `professional_council` INTEGER NOT NULL,

    PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddForeignKey
ALTER TABLE `service_takers_council_details` ADD CONSTRAINT `service_takers_council_details_professional_council_fkey` FOREIGN KEY (`professional_council`) REFERENCES `professional_councils`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
