c2cgeoportal-commons 2.7.1.156__py3-none-any.whl → 2.8.1.180__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of c2cgeoportal-commons might be problematic. Click here for more details.
- c2cgeoportal_commons/alembic/env.py +6 -7
- c2cgeoportal_commons/alembic/main/028477929d13_add_technical_roles.py +2 -2
- c2cgeoportal_commons/alembic/main/04f05bfbb05e_remove_the_old_is_expanded_column.py +1 -1
- c2cgeoportal_commons/alembic/main/116b9b79fc4d_internal_and_external_layer_tables_.py +34 -38
- c2cgeoportal_commons/alembic/main/1418cb05921b_merge_1_6_and_master_branches.py +1 -5
- c2cgeoportal_commons/alembic/main/164ac0819a61_add_image_format_to_wmts_layer.py +1 -1
- c2cgeoportal_commons/alembic/main/166ff2dcc48d_create_database.py +3 -3
- c2cgeoportal_commons/alembic/main/1d5d4abfebd1_add_restricted_theme.py +2 -2
- c2cgeoportal_commons/alembic/main/20137477bd02_update_icons_url.py +1 -1
- c2cgeoportal_commons/alembic/main/21f11066f8ec_trigger_on_role_updates_user_in_static.py +13 -15
- c2cgeoportal_commons/alembic/main/22e6dfb556de_add_description_tree_.py +1 -1
- c2cgeoportal_commons/alembic/main/29f2a32859ec_merge_1_6_and_master_branches.py +1 -5
- c2cgeoportal_commons/alembic/main/2b8ed8c1df94_set_layergroup_treeitem_is_as_a_primary_.py +1 -1
- c2cgeoportal_commons/alembic/main/32527659d57b_move_exclude_properties_from_layerv1_to_.py +7 -7
- c2cgeoportal_commons/alembic/main/32b21aa1d0ed_merge_e004f76e951a_and_e004f76e951a_.py +1 -5
- c2cgeoportal_commons/alembic/main/338b57593823_remove_trigger_on_role_name_change.py +15 -17
- c2cgeoportal_commons/alembic/main/415746eb9f6_changes_for_v2.py +30 -30
- c2cgeoportal_commons/alembic/main/44c91d82d419_add_table_log.py +70 -0
- c2cgeoportal_commons/alembic/main/5109242131ce_add_column_time_widget.py +1 -1
- c2cgeoportal_commons/alembic/main/53ba1a68d5fe_add_theme_to_fulltextsearch.py +1 -1
- c2cgeoportal_commons/alembic/main/54645a535ad6_add_ordering_in_relation.py +9 -9
- c2cgeoportal_commons/alembic/main/596ba21e3833_separate_local_internal.py +5 -9
- c2cgeoportal_commons/alembic/main/6a412d9437b1_rename_serverogc_to_ogcserver.py +3 -3
- c2cgeoportal_commons/alembic/main/7530011a66a7_trigger_on_role_updates_user_in_static.py +13 -15
- c2cgeoportal_commons/alembic/main/78fd093c8393_add_api_s_intrfaces.py +20 -44
- c2cgeoportal_commons/alembic/main/7d271f4527cd_add_layer_column_in_layerv1_table.py +1 -1
- c2cgeoportal_commons/alembic/main/809650bd04c3_add_dimension_field.py +1 -1
- c2cgeoportal_commons/alembic/main/8117bb9bba16_use_dimension_on_all_the_layers.py +3 -3
- c2cgeoportal_commons/alembic/main/9268a1dffac0_add_trigger_to_be_able_to_correctly_.py +1 -1
- c2cgeoportal_commons/alembic/main/94db7e7e5b21_merge_2_2_and_master_branches.py +1 -5
- c2cgeoportal_commons/alembic/main/951ff84bd8ec_be_able_to_delete_a_wms_layer_in_sql.py +1 -1
- c2cgeoportal_commons/alembic/main/a4f1aac9bda_merge_1_6_and_master_branches.py +1 -5
- c2cgeoportal_commons/alembic/main/b60f2a505f42_remame_uimetadata_to_metadata.py +1 -1
- c2cgeoportal_commons/alembic/main/d48a63b348f1_change_mapserver_url_for_docker.py +5 -9
- c2cgeoportal_commons/alembic/main/d8ef99bc227e_be_able_to_delete_a_linked_functionality.py +1 -1
- c2cgeoportal_commons/alembic/main/daf738d5bae4_merge_2_0_and_master_branches.py +1 -5
- c2cgeoportal_commons/alembic/main/dba87f2647f9_merge_2_2_on_2_3.py +1 -5
- c2cgeoportal_commons/alembic/main/e004f76e951a_add_missing_not_null.py +5 -21
- c2cgeoportal_commons/alembic/main/e7e03dedade3_put_the_default_wms_server_in_the_.py +5 -9
- c2cgeoportal_commons/alembic/main/ec82a8906649_add_missing_on_delete_cascade_on_layer_.py +1 -1
- c2cgeoportal_commons/alembic/main/ee25d267bf46_main_interface_desktop.py +3 -9
- c2cgeoportal_commons/alembic/main/eeb345672454_merge_2_4_and_master_branches.py +1 -5
- c2cgeoportal_commons/alembic/static/1857owc78a07_add_last_login_and_expiration_date.py +1 -1
- c2cgeoportal_commons/alembic/static/1da396a88908_move_user_table_to_static_schema.py +4 -8
- c2cgeoportal_commons/alembic/static/3f89a7d71a5e_alter_column_url_to_remove_limitation.py +1 -1
- c2cgeoportal_commons/alembic/static/44c91d82d419_add_table_log.py +70 -0
- c2cgeoportal_commons/alembic/static/53d671b17b20_add_timezone_on_datetime_fields.py +1 -1
- c2cgeoportal_commons/alembic/static/5472fbc19f39_add_temp_password_column.py +1 -1
- c2cgeoportal_commons/alembic/static/76d72fb3fcb9_add_oauth2_pkce.py +68 -0
- c2cgeoportal_commons/alembic/static/7ef947f30f20_add_oauth2_tables.py +1 -1
- c2cgeoportal_commons/alembic/static/ae5e88f35669_add_table_user_role.py +7 -13
- c2cgeoportal_commons/lib/url.py +1 -1
- c2cgeoportal_commons/lib/validators.py +1 -3
- c2cgeoportal_commons/models/__init__.py +2 -2
- c2cgeoportal_commons/models/main.py +101 -7
- c2cgeoportal_commons/models/sqlalchemy.py +7 -8
- c2cgeoportal_commons/models/static.py +44 -2
- c2cgeoportal_commons/testing/__init__.py +3 -2
- {c2cgeoportal_commons-2.7.1.156.dist-info → c2cgeoportal_commons-2.8.1.180.dist-info}/METADATA +8 -4
- {c2cgeoportal_commons-2.7.1.156.dist-info → c2cgeoportal_commons-2.8.1.180.dist-info}/RECORD +62 -59
- {c2cgeoportal_commons-2.7.1.156.dist-info → c2cgeoportal_commons-2.8.1.180.dist-info}/WHEEL +0 -0
- {c2cgeoportal_commons-2.7.1.156.dist-info → c2cgeoportal_commons-2.8.1.180.dist-info}/top_level.txt +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2014-
|
|
1
|
+
# Copyright (c) 2014-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -53,13 +53,13 @@ def upgrade() -> None:
|
|
|
53
53
|
op.add_column("layergroup_treeitem", Column("id", Integer, primary_key=True), schema=schema)
|
|
54
54
|
op.add_column("layergroup_treeitem", Column("ordering", Integer), schema=schema)
|
|
55
55
|
op.execute(
|
|
56
|
-
'UPDATE ONLY
|
|
57
|
-
"FROM
|
|
56
|
+
f'UPDATE ONLY {schema}.layergroup_treeitem AS lt SET ordering = ti."order" '
|
|
57
|
+
f"FROM {schema}.treeitem AS ti WHERE ti.id = lt.treeitem_id "
|
|
58
58
|
)
|
|
59
59
|
op.add_column("theme", Column("ordering", Integer), schema=schema)
|
|
60
60
|
op.execute(
|
|
61
|
-
'UPDATE ONLY
|
|
62
|
-
"FROM
|
|
61
|
+
f'UPDATE ONLY {schema}.theme AS t SET ordering = ti."order" '
|
|
62
|
+
f"FROM {schema}.treeitem AS ti WHERE ti.id = t.id "
|
|
63
63
|
)
|
|
64
64
|
op.drop_column("treeitem", "order", schema=schema)
|
|
65
65
|
|
|
@@ -69,12 +69,12 @@ def downgrade() -> None:
|
|
|
69
69
|
schema = config["schema"]
|
|
70
70
|
op.add_column("treeitem", Column("order", Integer), schema=schema)
|
|
71
71
|
op.execute(
|
|
72
|
-
'UPDATE ONLY
|
|
73
|
-
"FROM
|
|
72
|
+
f'UPDATE ONLY {schema}.treeitem AS ti SET "order" = lt.ordering '
|
|
73
|
+
f"FROM {schema}.layergroup_treeitem AS lt WHERE ti.id = lt.treeitem_id "
|
|
74
74
|
)
|
|
75
75
|
op.execute(
|
|
76
|
-
'UPDATE ONLY
|
|
77
|
-
"FROM
|
|
76
|
+
f'UPDATE ONLY {schema}.treeitem AS ti SET "order" = t.ordering '
|
|
77
|
+
f"FROM {schema}.theme AS t WHERE ti.id = t.id "
|
|
78
78
|
)
|
|
79
79
|
op.drop_column("theme", "ordering", schema=schema)
|
|
80
80
|
op.drop_column("layergroup_treeitem", "ordering", schema=schema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -50,13 +50,11 @@ def upgrade() -> None:
|
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
52
|
op.execute(
|
|
53
|
-
"""
|
|
53
|
+
f"""
|
|
54
54
|
UPDATE "{schema}".ogc_server
|
|
55
55
|
SET url = 'config://internal/mapserv'
|
|
56
56
|
WHERE url = 'config://local/mapserv'
|
|
57
|
-
|
|
58
|
-
schema=schema
|
|
59
|
-
)
|
|
57
|
+
"""
|
|
60
58
|
)
|
|
61
59
|
|
|
62
60
|
|
|
@@ -65,11 +63,9 @@ def downgrade() -> None:
|
|
|
65
63
|
schema = config["schema"]
|
|
66
64
|
|
|
67
65
|
op.execute(
|
|
68
|
-
"""
|
|
66
|
+
f"""
|
|
69
67
|
UPDATE "{schema}".ogc_server
|
|
70
68
|
SET url = 'config://local/mapserv'
|
|
71
69
|
WHERE url = 'config://internal/mapserv'
|
|
72
|
-
|
|
73
|
-
schema=schema
|
|
74
|
-
)
|
|
70
|
+
"""
|
|
75
71
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -50,7 +50,7 @@ def upgrade() -> None:
|
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
52
|
op.rename_table("server_ogc", "ogc_server", schema=schema)
|
|
53
|
-
with op.batch_alter_table("layer_wms", schema=schema) as table_op:
|
|
53
|
+
with op.batch_alter_table("layer_wms", schema=schema) as table_op:
|
|
54
54
|
table_op.alter_column("server_ogc_id", new_column_name="ogc_server_id")
|
|
55
55
|
|
|
56
56
|
|
|
@@ -59,5 +59,5 @@ def downgrade() -> None:
|
|
|
59
59
|
schema = config["schema"]
|
|
60
60
|
|
|
61
61
|
op.rename_table("ogc_server", "server_ogc", schema=schema)
|
|
62
|
-
with op.batch_alter_table("layer_wms", schema=schema) as table_op:
|
|
62
|
+
with op.batch_alter_table("layer_wms", schema=schema) as table_op:
|
|
63
63
|
table_op.alter_column("ogc_server_id", new_column_name="server_ogc_id")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2018-
|
|
1
|
+
# Copyright (c) 2018-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -51,20 +51,18 @@ def upgrade() -> None:
|
|
|
51
51
|
staticschema = config["schema_static"]
|
|
52
52
|
|
|
53
53
|
op.execute(
|
|
54
|
-
"""
|
|
55
|
-
CREATE OR REPLACE FUNCTION {schema}.on_role_name_change()
|
|
56
|
-
RETURNS trigger AS
|
|
57
|
-
$$
|
|
58
|
-
BEGIN
|
|
59
|
-
IF NEW.name <> OLD.name THEN
|
|
60
|
-
UPDATE {staticschema}."user" SET role_name = NEW.name WHERE role_name = OLD.name;
|
|
61
|
-
END IF;
|
|
62
|
-
RETURN NEW;
|
|
63
|
-
END;
|
|
64
|
-
$$
|
|
65
|
-
LANGUAGE plpgsql"""
|
|
66
|
-
schema=schema, staticschema=staticschema
|
|
67
|
-
)
|
|
54
|
+
f"""
|
|
55
|
+
CREATE OR REPLACE FUNCTION {schema}.on_role_name_change()
|
|
56
|
+
RETURNS trigger AS
|
|
57
|
+
$$
|
|
58
|
+
BEGIN
|
|
59
|
+
IF NEW.name <> OLD.name THEN
|
|
60
|
+
UPDATE {staticschema}."user" SET role_name = NEW.name WHERE role_name = OLD.name;
|
|
61
|
+
END IF;
|
|
62
|
+
RETURN NEW;
|
|
63
|
+
END;
|
|
64
|
+
$$
|
|
65
|
+
LANGUAGE plpgsql"""
|
|
68
66
|
)
|
|
69
67
|
|
|
70
68
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2019-
|
|
1
|
+
# Copyright (c) 2019-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
# pylint: disable=no-member
|
|
29
29
|
|
|
30
30
|
"""
|
|
31
|
-
Add API's
|
|
31
|
+
Add API's interfaces.
|
|
32
32
|
|
|
33
33
|
Revision ID: 78fd093c8393
|
|
34
34
|
Revises: e85afd327ab3
|
|
@@ -56,38 +56,26 @@ def upgrade() -> None:
|
|
|
56
56
|
connection = op.get_bind()
|
|
57
57
|
for interface_name in ("api", "iframe_api"):
|
|
58
58
|
result = connection.execute(
|
|
59
|
-
"SELECT count(name) FROM {schema}.interface WHERE name='{
|
|
60
|
-
name=interface_name, schema=schema
|
|
61
|
-
)
|
|
59
|
+
f"SELECT count(name) FROM {schema}.interface WHERE name='{interface_name}'"
|
|
62
60
|
)
|
|
63
61
|
if result.fetchone()[0] == 0:
|
|
64
62
|
op.bulk_insert(interface, [{"name": interface_name}])
|
|
65
63
|
for interface_name in ("edit", "routing"):
|
|
66
64
|
result = connection.execute(
|
|
67
|
-
"SELECT count(name) FROM {schema}.interface WHERE name='{
|
|
68
|
-
name=interface_name, schema=schema
|
|
69
|
-
)
|
|
65
|
+
f"SELECT count(name) FROM {schema}.interface WHERE name='{interface_name}'"
|
|
70
66
|
)
|
|
71
67
|
if result.fetchone()[0] != 0:
|
|
72
68
|
op.execute(
|
|
73
|
-
"DELETE FROM {schema}.interface_theme it "
|
|
74
|
-
"USING {schema}.interface i "
|
|
75
|
-
"WHERE it.interface_id = i.id AND i.name = '{
|
|
76
|
-
name=interface_name, schema=schema
|
|
77
|
-
)
|
|
78
|
-
)
|
|
79
|
-
op.execute(
|
|
80
|
-
"DELETE FROM {schema}.interface_layer il "
|
|
81
|
-
"USING {schema}.interface i "
|
|
82
|
-
"WHERE il.interface_id = i.id AND i.name = '{name}'".format(
|
|
83
|
-
name=interface_name, schema=schema
|
|
84
|
-
)
|
|
69
|
+
f"DELETE FROM {schema}.interface_theme it "
|
|
70
|
+
f"USING {schema}.interface i "
|
|
71
|
+
f"WHERE it.interface_id = i.id AND i.name = '{interface_name}'"
|
|
85
72
|
)
|
|
86
73
|
op.execute(
|
|
87
|
-
"DELETE FROM {schema}.
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
f"DELETE FROM {schema}.interface_layer il "
|
|
75
|
+
f"USING {schema}.interface i "
|
|
76
|
+
f"WHERE il.interface_id = i.id AND i.name = '{interface_name}'"
|
|
90
77
|
)
|
|
78
|
+
op.execute(f"DELETE FROM {schema}.interface WHERE name='{interface_name}'")
|
|
91
79
|
|
|
92
80
|
|
|
93
81
|
def downgrade() -> None:
|
|
@@ -99,35 +87,23 @@ def downgrade() -> None:
|
|
|
99
87
|
connection = op.get_bind()
|
|
100
88
|
for interface_name in ("edit", "routing"):
|
|
101
89
|
result = connection.execute(
|
|
102
|
-
"SELECT count(name) FROM {schema}.interface WHERE name='{
|
|
103
|
-
name=interface_name, schema=schema
|
|
104
|
-
)
|
|
90
|
+
f"SELECT count(name) FROM {schema}.interface WHERE name='{interface_name}'"
|
|
105
91
|
)
|
|
106
92
|
if result.fetchone()[0] == 0:
|
|
107
93
|
op.bulk_insert(interface, [{"name": interface_name}])
|
|
108
94
|
for interface_name in ("api", "iframe_api"):
|
|
109
95
|
result = connection.execute(
|
|
110
|
-
"SELECT count(name) FROM {schema}.interface WHERE name='{
|
|
111
|
-
name=interface_name, schema=schema
|
|
112
|
-
)
|
|
96
|
+
f"SELECT count(name) FROM {schema}.interface WHERE name='{interface_name}'"
|
|
113
97
|
)
|
|
114
98
|
if result.fetchone()[0] != 0:
|
|
115
99
|
op.execute(
|
|
116
|
-
"DELETE FROM {schema}.interface_theme it "
|
|
117
|
-
"USING {schema}.interface i "
|
|
118
|
-
"WHERE it.interface_id = i.id AND i.name = '{
|
|
119
|
-
name=interface_name, schema=schema
|
|
120
|
-
)
|
|
121
|
-
)
|
|
122
|
-
op.execute(
|
|
123
|
-
"DELETE FROM {schema}.interface_layer il "
|
|
124
|
-
"USING {schema}.interface i "
|
|
125
|
-
"WHERE il.interface_id = i.id AND i.name = '{name}'".format(
|
|
126
|
-
name=interface_name, schema=schema
|
|
127
|
-
)
|
|
100
|
+
f"DELETE FROM {schema}.interface_theme it "
|
|
101
|
+
f"USING {schema}.interface i "
|
|
102
|
+
f"WHERE it.interface_id = i.id AND i.name = '{interface_name}'"
|
|
128
103
|
)
|
|
129
104
|
op.execute(
|
|
130
|
-
"DELETE FROM {schema}.
|
|
131
|
-
|
|
132
|
-
|
|
105
|
+
f"DELETE FROM {schema}.interface_layer il "
|
|
106
|
+
f"USING {schema}.interface i "
|
|
107
|
+
f"WHERE il.interface_id = i.id AND i.name = '{interface_name}'"
|
|
133
108
|
)
|
|
109
|
+
op.execute(f"DELETE FROM {schema}.interface WHERE name='{interface_name}'")
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -50,7 +50,7 @@ def upgrade() -> None:
|
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
52
|
op.rename_table("wmts_dimension", "dimension", schema=schema)
|
|
53
|
-
with op.batch_alter_table("dimension", schema=schema) as table_op:
|
|
53
|
+
with op.batch_alter_table("dimension", schema=schema) as table_op:
|
|
54
54
|
table_op.drop_constraint("wmts_dimension_layer_id_fkey", type_="foreignkey")
|
|
55
55
|
table_op.create_foreign_key(
|
|
56
56
|
"dimension_layer_id_fkey",
|
|
@@ -65,7 +65,7 @@ def downgrade() -> None:
|
|
|
65
65
|
"""Downgrade."""
|
|
66
66
|
schema = config["schema"]
|
|
67
67
|
|
|
68
|
-
with op.batch_alter_table("dimension", schema=schema) as table_op:
|
|
68
|
+
with op.batch_alter_table("dimension", schema=schema) as table_op:
|
|
69
69
|
table_op.drop_constraint("dimension_layer_id_fkey", type_="foreignkey")
|
|
70
70
|
table_op.create_foreign_key(
|
|
71
71
|
"wmts_dimension_layer_id_fkey",
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2017-2021, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2017-2023, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,8 +25,6 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=no-member
|
|
31
|
-
|
|
32
28
|
"""
|
|
33
29
|
Merge 2.2 and master branches.
|
|
34
30
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2015-2019, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2015-2023, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,8 +25,6 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=no-member
|
|
31
|
-
|
|
32
28
|
"""
|
|
33
29
|
Merge 1.6 and master branches.
|
|
34
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2017-
|
|
1
|
+
# Copyright (c) 2017-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -51,13 +51,11 @@ def upgrade() -> None:
|
|
|
51
51
|
|
|
52
52
|
# Instructions
|
|
53
53
|
op.execute(
|
|
54
|
-
"""
|
|
54
|
+
f"""
|
|
55
55
|
UPDATE "{schema}".ogc_server
|
|
56
56
|
SET url = 'config://mapserver'
|
|
57
57
|
WHERE url = 'config://internal/mapserv'
|
|
58
|
-
|
|
59
|
-
schema=schema
|
|
60
|
-
)
|
|
58
|
+
"""
|
|
61
59
|
)
|
|
62
60
|
|
|
63
61
|
|
|
@@ -67,11 +65,9 @@ def downgrade() -> None:
|
|
|
67
65
|
|
|
68
66
|
# Instructions
|
|
69
67
|
op.execute(
|
|
70
|
-
"""
|
|
68
|
+
f"""
|
|
71
69
|
UPDATE "{schema}".ogc_server
|
|
72
70
|
SET url = 'config://internal/mapserv'
|
|
73
71
|
WHERE url = 'config://mapserver'
|
|
74
|
-
|
|
75
|
-
schema=schema
|
|
76
|
-
)
|
|
72
|
+
"""
|
|
77
73
|
)
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2016-2019, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,8 +25,6 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=no-member
|
|
31
|
-
|
|
32
28
|
"""
|
|
33
29
|
Merge 2.0 and master branches.
|
|
34
30
|
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2018-2019, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2018-2023, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,8 +25,6 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=no-member
|
|
31
|
-
|
|
32
28
|
"""
|
|
33
29
|
Merge 2.2 on 2.3.
|
|
34
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -51,31 +51,15 @@ def upgrade() -> None:
|
|
|
51
51
|
|
|
52
52
|
op.alter_column("layer_wmts", "url", nullable=False, schema=schema)
|
|
53
53
|
op.alter_column("layer_wmts", "layer", nullable=False, schema=schema)
|
|
54
|
-
op.execute(
|
|
55
|
-
"UPDATE ONLY {schema}.layer_wmts SET image_type = 'image/png' where image_type IS NULL".format(
|
|
56
|
-
schema=schema
|
|
57
|
-
)
|
|
58
|
-
)
|
|
54
|
+
op.execute(f"UPDATE ONLY {schema}.layer_wmts SET image_type = 'image/png' where image_type IS NULL")
|
|
59
55
|
op.alter_column("layer_wmts", "image_type", nullable=False, schema=schema)
|
|
60
56
|
op.alter_column("layer_wms", "ogc_server_id", nullable=False, schema=schema)
|
|
61
57
|
op.alter_column("layer_wms", "layer", nullable=False, schema=schema)
|
|
62
|
-
op.execute(
|
|
63
|
-
"UPDATE ONLY {schema}.layer_wms SET time_mode = 'disabled' where time_mode IS NULL".format(
|
|
64
|
-
schema=schema
|
|
65
|
-
)
|
|
66
|
-
)
|
|
58
|
+
op.execute(f"UPDATE ONLY {schema}.layer_wms SET time_mode = 'disabled' where time_mode IS NULL")
|
|
67
59
|
op.alter_column("layer_wms", "time_mode", nullable=False, schema=schema)
|
|
68
|
-
op.execute(
|
|
69
|
-
"UPDATE ONLY {schema}.layer_wms SET time_widget = 'slider' where time_widget IS NULL".format(
|
|
70
|
-
schema=schema
|
|
71
|
-
)
|
|
72
|
-
)
|
|
60
|
+
op.execute(f"UPDATE ONLY {schema}.layer_wms SET time_widget = 'slider' where time_widget IS NULL")
|
|
73
61
|
op.alter_column("layer_wms", "time_widget", nullable=False, schema=schema)
|
|
74
|
-
op.execute(
|
|
75
|
-
"UPDATE ONLY {schema}.ogc_server SET image_type = 'image/png' where image_type IS NULL".format(
|
|
76
|
-
schema=schema
|
|
77
|
-
)
|
|
78
|
-
)
|
|
62
|
+
op.execute(f"UPDATE ONLY {schema}.ogc_server SET image_type = 'image/png' where image_type IS NULL")
|
|
79
63
|
op.alter_column("ogc_server", "image_type", nullable=False, schema=schema)
|
|
80
64
|
op.execute(f"UPDATE ONLY {schema}.ogc_server SET type = 'mapserver' where type IS NULL")
|
|
81
65
|
op.alter_column("ogc_server", "type", nullable=False, schema=schema)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -50,13 +50,11 @@ def upgrade() -> None:
|
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
52
|
op.execute(
|
|
53
|
-
"""
|
|
53
|
+
f"""
|
|
54
54
|
UPDATE "{schema}".ogc_server
|
|
55
55
|
SET url = 'config://local/mapserv'
|
|
56
56
|
WHERE url IS NULL
|
|
57
|
-
|
|
58
|
-
schema=schema
|
|
59
|
-
)
|
|
57
|
+
"""
|
|
60
58
|
)
|
|
61
59
|
|
|
62
60
|
op.alter_column("ogc_server", "url", nullable=False, schema=schema)
|
|
@@ -75,11 +73,9 @@ def downgrade() -> None:
|
|
|
75
73
|
op.drop_constraint("type_name_unique_treeitem", "treeitem", schema=schema)
|
|
76
74
|
|
|
77
75
|
op.execute(
|
|
78
|
-
"""
|
|
76
|
+
f"""
|
|
79
77
|
UPDATE "{schema}".ogc_server
|
|
80
78
|
SET url = NULL
|
|
81
79
|
WHERE url = 'config://local/mapserv'
|
|
82
|
-
|
|
83
|
-
schema=schema
|
|
84
|
-
)
|
|
80
|
+
"""
|
|
85
81
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2016-
|
|
1
|
+
# Copyright (c) 2016-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -49,17 +49,11 @@ def upgrade() -> None:
|
|
|
49
49
|
"""Upgrade."""
|
|
50
50
|
schema = config["schema"]
|
|
51
51
|
|
|
52
|
-
op.execute(
|
|
53
|
-
"UPDATE ONLY {schema}.interface AS i "
|
|
54
|
-
"SET name = 'desktop' where name = 'main'".format(schema=schema)
|
|
55
|
-
)
|
|
52
|
+
op.execute(f"UPDATE ONLY {schema}.interface AS i SET name = 'desktop' where name = 'main'")
|
|
56
53
|
|
|
57
54
|
|
|
58
55
|
def downgrade() -> None:
|
|
59
56
|
"""Downgrade."""
|
|
60
57
|
schema = config["schema"]
|
|
61
58
|
|
|
62
|
-
op.execute(
|
|
63
|
-
"UPDATE ONLY {schema}.interface AS i "
|
|
64
|
-
"SET name = 'main' where name = 'desktop'".format(schema=schema)
|
|
65
|
-
)
|
|
59
|
+
op.execute(f"UPDATE ONLY {schema}.interface AS i SET name = 'main' where name = 'desktop'")
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
# Copyright (c) 2019-2021, Camptocamp SA
|
|
1
|
+
# Copyright (c) 2019-2023, Camptocamp SA
|
|
4
2
|
# All rights reserved.
|
|
5
3
|
|
|
6
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -27,8 +25,6 @@
|
|
|
27
25
|
# of the authors and should not be interpreted as representing official policies,
|
|
28
26
|
# either expressed or implied, of the FreeBSD Project.
|
|
29
27
|
|
|
30
|
-
# pylint: disable=no-member
|
|
31
|
-
|
|
32
28
|
"""
|
|
33
29
|
Merge 2.4 and master branches.
|
|
34
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Copyright (c) 2015-
|
|
1
|
+
# Copyright (c) 2015-2023, Camptocamp SA
|
|
2
2
|
# All rights reserved.
|
|
3
3
|
|
|
4
4
|
# Redistribution and use in source and binary forms, with or without
|
|
@@ -55,7 +55,7 @@ def upgrade() -> None:
|
|
|
55
55
|
|
|
56
56
|
engine = op.get_bind().engine
|
|
57
57
|
with engine.connect() as connection:
|
|
58
|
-
if type(engine).__name__ != "MockConnection" and op.get_context().dialect.has_table(
|
|
58
|
+
if type(engine).__name__ != "MockConnection" and op.get_context().dialect.has_table(
|
|
59
59
|
connection, "user", schema=staticschema
|
|
60
60
|
):
|
|
61
61
|
return
|
|
@@ -78,9 +78,7 @@ def upgrade() -> None:
|
|
|
78
78
|
op.add_column("user", Column("parent_role_name", String), schema=staticschema)
|
|
79
79
|
parent_column = ", parent_role_name"
|
|
80
80
|
parent_select = ", pr.name"
|
|
81
|
-
parent_join = "LEFT OUTER JOIN {parentschema!s}.role AS pr ON (pr.id = u.parent_role_id)"
|
|
82
|
-
parentschema=parentschema
|
|
83
|
-
)
|
|
81
|
+
parent_join = f"LEFT OUTER JOIN {parentschema!s}.role AS pr ON (pr.id = u.parent_role_id)"
|
|
84
82
|
|
|
85
83
|
try:
|
|
86
84
|
op.execute(
|
|
@@ -134,9 +132,7 @@ def downgrade() -> None:
|
|
|
134
132
|
)
|
|
135
133
|
parent_column = ", parent_role_id"
|
|
136
134
|
parent_select = ", pr.id"
|
|
137
|
-
parent_join = "LEFT OUTER JOIN {parentschema}.role AS pr ON (pr.name = u.parent_role_name)"
|
|
138
|
-
parentschema=parentschema
|
|
139
|
-
)
|
|
135
|
+
parent_join = f"LEFT OUTER JOIN {parentschema}.role AS pr ON (pr.name = u.parent_role_name)"
|
|
140
136
|
|
|
141
137
|
op.execute(
|
|
142
138
|
"INSERT INTO %(schema)s.user "
|