Исправлена работа апдейтера.
This commit is contained in:
@@ -5,6 +5,3 @@ COPY "{{tablename}}_TEMP" ({{fieldslist}}) FROM '{{csvname}}' DELIMITER '{{delim
|
||||
INSERT INTO "{{tablename}}" ({{fieldslist}}) SELECT {{fieldslist}}
|
||||
FROM
|
||||
"{{tablename}}_TEMP" ON CONFLICT ({{uniquekey}}) DO UPDATE SET {{updaterule}};
|
||||
% if tablename=="ADDROBJ":
|
||||
DELETE FROM "{{tablename}}" WHERE ACTSTATUS = FALSE OR NEXTID IS NOT NULL;
|
||||
% end
|
||||
|
||||
@@ -1,10 +1,18 @@
|
||||
% for table_name in table_names:
|
||||
% if table_name == "ADDROBJ":
|
||||
CREATE INDEX "sphinx_ind_aolevel" ON "ADDROBJ" USING btree ("aolevel");
|
||||
CREATE INDEX "sphinx_ind_parentguid" ON "ADDROBJ" USING btree ("parentguid");
|
||||
CREATE INDEX "sphinx_ind_livestatus" ON "ADDROBJ" USING btree ("actstatus", "livestatus", "nextid");
|
||||
CREATE INDEX "sphinx_ind_aoguid" ON "ADDROBJ" USING btree ("aoguid");
|
||||
% end
|
||||
% if table_name == "SOCRBASE":
|
||||
CREATE INDEX "SOCRBASE_scname_idx" ON "SOCRBASE" USING btree ("scname");
|
||||
CREATE INDEX "SOCRBASE_socrname_idx" ON "SOCRBASE" USING btree ("socrname");
|
||||
CREATE INDEX "SOCRBASE_scname_gin_idx" ON "SOCRBASE" USING gin(scname gin_trgm_ops);
|
||||
CREATE INDEX "SOCRBASE_socrname_gin_idx" ON "SOCRBASE" USING gin(socrname gin_trgm_ops);
|
||||
% end
|
||||
% if table_name == "AOTRIG":
|
||||
CREATE INDEX "AOTRIG_word_idx" ON "AOTRIG" USING btree ("word");
|
||||
CREATE INDEX "AOTRIG_word_gin_idx" ON "AOTRIG" USING gin(word gin_trgm_ops);
|
||||
% end
|
||||
% end
|
||||
@@ -13,8 +13,7 @@ CREATE TABLE "ADDROBJ" (
|
||||
CONSTRAINT "aoid" UNIQUE ("aoid"),
|
||||
CONSTRAINT "id_addrobj" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (OIDS =FALSE
|
||||
);
|
||||
WITH (OIDS =FALSE);
|
||||
DROP TABLE IF EXISTS "SOCRBASE";
|
||||
CREATE TABLE "SOCRBASE" (
|
||||
"id" SERIAL4 NOT NULL,
|
||||
@@ -25,8 +24,7 @@ CREATE TABLE "SOCRBASE" (
|
||||
CONSTRAINT "kod_t_st" UNIQUE ("kod_t_st"),
|
||||
CONSTRAINT "id_socrbase" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (OIDS =FALSE
|
||||
);
|
||||
WITH (OIDS =FALSE);
|
||||
DROP TABLE IF EXISTS "AOTRIG";
|
||||
CREATE TABLE "AOTRIG" (
|
||||
"id" SERIAL4 NOT NULL,
|
||||
@@ -36,5 +34,12 @@ CREATE TABLE "AOTRIG" (
|
||||
CONSTRAINT "word" UNIQUE ("word"),
|
||||
CONSTRAINT "id_aotrig" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (OIDS =FALSE
|
||||
);
|
||||
WITH (OIDS =FALSE);
|
||||
DROP TABLE IF EXISTS "CONFIG";
|
||||
CREATE TABLE "CONFIG" (
|
||||
"id" int4 NOT NULL,
|
||||
"version" int4,
|
||||
CONSTRAINT "id_config" PRIMARY KEY ("id")
|
||||
)
|
||||
WITH (OIDS=FALSE);
|
||||
INSERT INTO "public"."CONFIG" VALUES ('0', '0');
|
||||
18
aore/templates/postgre/drop_indexes.sql
Normal file
18
aore/templates/postgre/drop_indexes.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
% for table_name in table_names:
|
||||
% if table_name == "ADDROBJ":
|
||||
DROP INDEX IF EXISTS "sphinx_ind_aolevel";
|
||||
DROP INDEX IF EXISTS "sphinx_ind_parentguid";
|
||||
DROP INDEX IF EXISTS "sphinx_ind_livestatus";
|
||||
DROP INDEX IF EXISTS "sphinx_ind_aoguid";
|
||||
% end
|
||||
% if table_name == "SOCRBASE":
|
||||
DROP INDEX IF EXISTS "SOCRBASE_scname_idx";
|
||||
DROP INDEX IF EXISTS "SOCRBASE_socrname_idx";
|
||||
DROP INDEX IF EXISTS "SOCRBASE_scname_gin_idx";
|
||||
DROP INDEX IF EXISTS "SOCRBASE_socrname_gin_idx";
|
||||
% end
|
||||
% if table_name == "AOTRIG":
|
||||
DROP INDEX IF EXISTS "AOTRIG_word_idx";
|
||||
DROP INDEX IF EXISTS "AOTRIG_word_gin_idx";
|
||||
% end
|
||||
% end
|
||||
@@ -26,7 +26,8 @@ index {{ index_name }}
|
||||
html_strip = 1
|
||||
|
||||
ignore_chars = @, -
|
||||
|
||||
charset_table = 0..9, A..Z->a..z, _, a..z, \
|
||||
U+0401->U+0435, U+0451->U+0435, \
|
||||
U+410..U+42F->U+430..U+44F, U+430..U+44F
|
||||
|
||||
source = {{index_name}}
|
||||
|
||||
Reference in New Issue
Block a user