-- RedefineTables
PRAGMA defer_foreign_keys=ON;
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_configuraciones_tributarias" (
    "id" TEXT NOT NULL PRIMARY KEY,
    "ambiente" TEXT NOT NULL,
    "tipoEmision" TEXT NOT NULL,
    "razonSocial" TEXT NOT NULL,
    "nombreComercial" TEXT NOT NULL,
    "ruc" TEXT NOT NULL,
    "dirMatriz" TEXT NOT NULL,
    "dirEstablecimiento" TEXT NOT NULL DEFAULT '',
    "estab" TEXT NOT NULL,
    "ptoEmi" TEXT NOT NULL,
    "secuencial" TEXT NOT NULL,
    "obligadoContabilidad" TEXT NOT NULL DEFAULT 'NO',
    "activo" BOOLEAN NOT NULL DEFAULT true,
    "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "updatedAt" DATETIME NOT NULL
);
INSERT INTO "new_configuraciones_tributarias" ("activo", "ambiente", "createdAt", "dirMatriz", "estab", "id", "nombreComercial", "obligadoContabilidad", "ptoEmi", "razonSocial", "ruc", "secuencial", "tipoEmision", "updatedAt") SELECT "activo", "ambiente", "createdAt", "dirMatriz", "estab", "id", "nombreComercial", "obligadoContabilidad", "ptoEmi", "razonSocial", "ruc", "secuencial", "tipoEmision", "updatedAt" FROM "configuraciones_tributarias";
DROP TABLE "configuraciones_tributarias";
ALTER TABLE "new_configuraciones_tributarias" RENAME TO "configuraciones_tributarias";
CREATE UNIQUE INDEX "configuraciones_tributarias_ruc_key" ON "configuraciones_tributarias"("ruc");
PRAGMA foreign_keys=ON;
PRAGMA defer_foreign_keys=OFF;
