uat-doc-perfix
This commit is contained in:
28
drizzle/0008_document_sequence_scope_refactor.sql
Normal file
28
drizzle/0008_document_sequence_scope_refactor.sql
Normal file
@@ -0,0 +1,28 @@
|
||||
ALTER TABLE "document_sequences"
|
||||
ADD COLUMN "product_type" text DEFAULT 'all' NOT NULL;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "document_sequences"
|
||||
ADD COLUMN "format" text DEFAULT '{prefix}{period}-{running}' NOT NULL;
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "document_sequences"
|
||||
ADD COLUMN "reset_policy" text DEFAULT 'period' NOT NULL;
|
||||
--> statement-breakpoint
|
||||
UPDATE "document_sequences"
|
||||
SET
|
||||
"product_type" = CASE
|
||||
WHEN "document_type" = 'quotation' THEN 'legacy'
|
||||
ELSE 'all'
|
||||
END,
|
||||
"format" = '{prefix}{period}-{running}',
|
||||
"reset_policy" = 'period';
|
||||
--> statement-breakpoint
|
||||
DROP INDEX "document_sequences_org_doc_period_branch_idx";
|
||||
--> statement-breakpoint
|
||||
CREATE UNIQUE INDEX "document_sequences_org_branch_product_doc_period_idx"
|
||||
ON "document_sequences" USING btree (
|
||||
"organization_id",
|
||||
"branch_id",
|
||||
"product_type",
|
||||
"document_type",
|
||||
"period"
|
||||
);
|
||||
@@ -57,6 +57,13 @@
|
||||
"when": 1782910000000,
|
||||
"tag": "0007_document_library_foundation",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 8,
|
||||
"version": "7",
|
||||
"when": 1782913600000,
|
||||
"tag": "0008_document_sequence_scope_refactor",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user