Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

schema 300 leftovers #159

Merged
merged 70 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
5b725c6
Set up migration files
margrietpalm Sep 10, 2024
dfd92c3
wip - migration db schema
margrietpalm Sep 10, 2024
b41b159
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Sep 10, 2024
4fccf28
Wip: write migration
margrietpalm Sep 11, 2024
88cbcd9
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Sep 12, 2024
fbe8a31
Removed unused ZoomCategories
margrietpalm Sep 12, 2024
8616809
Fix mistake in migration related to unexpected columns in the source …
margrietpalm Sep 12, 2024
11cfc33
WIP: fix things I think
margrietpalm Sep 23, 2024
d72fbee
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Sep 30, 2024
c6a47f3
Fix things so all tests pass
margrietpalm Sep 30, 2024
08ccc87
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Oct 1, 2024
53f78dd
Remove setting views on upgrading
margrietpalm Oct 1, 2024
5897b05
Use unique name for temp table
margrietpalm Oct 1, 2024
c37b897
Add tests for migration
margrietpalm Oct 1, 2024
115ceee
Use models.Material instead of local Material class
margrietpalm Oct 1, 2024
a805be3
Clean up and small fix
margrietpalm Oct 1, 2024
a1452c2
Ensure id is copied
margrietpalm Oct 2, 2024
330240e
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Oct 2, 2024
f438d80
Rename some columns
margrietpalm Oct 2, 2024
3be33b0
rename manhole_indicator to visualisation
margrietpalm Oct 2, 2024
c406984
Add todo
margrietpalm Oct 3, 2024
85a208d
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Oct 3, 2024
3128a59
Make cross_section_location.cross_section_width and cross_section_hei…
margrietpalm Oct 4, 2024
aef59cb
Extend CrossSectionShape to make it easier to check shape configuration
margrietpalm Oct 14, 2024
972a2d5
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Oct 14, 2024
3e8fa69
Fix migration numbering
margrietpalm Oct 14, 2024
99ba21a
bump version for dev release
margrietpalm Oct 17, 2024
dc26680
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Oct 21, 2024
7aae81f
Correct creating cross_section_table
margrietpalm Oct 22, 2024
6806269
Rename manhole_bottom_level to bottom_level
margrietpalm Oct 23, 2024
b2905b5
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Oct 30, 2024
07440a8
Change 227 in several names to 228
margrietpalm Oct 31, 2024
9639cea
Remove outdated TODO
margrietpalm Oct 31, 2024
0eadbbb
Merge branch 'margriet_89_schema_300_1D' of github.com:nens/threedi-s…
margrietpalm Oct 31, 2024
33841c9
update changes
margrietpalm Nov 4, 2024
9f57893
Merge branch 'master' into margriet_89_schema_300_1D
margrietpalm Nov 4, 2024
ac89605
Bump dev version
margrietpalm Nov 4, 2024
2c93d20
Fix changes typo
margrietpalm Nov 4, 2024
d7d16ce
Make ModelSettings.node_open_water_detection an Enum of type NodeOpen…
margrietpalm Nov 5, 2024
ce1709b
Remove nullable constraint from some columns
margrietpalm Nov 11, 2024
9603133
Correct names in StructureControlTypes
margrietpalm Nov 11, 2024
f97e95b
bump version
margrietpalm Nov 11, 2024
df0982e
Migrate material_id values 9 and 10
margrietpalm Nov 11, 2024
7681d49
Prevent conflicting table names from breaking migration
margrietpalm Nov 11, 2024
734d902
Prevent empty strings from being copied as text
margrietpalm Nov 11, 2024
9b782c4
Delete temp table and v2_manhole after migration
margrietpalm Nov 15, 2024
31de3ae
Add get_legacy_value to StructureControlTypes to retrieve the name us…
margrietpalm Nov 19, 2024
365e274
bump version
margrietpalm Nov 19, 2024
f1adfd6
Fix number in changes
margrietpalm Nov 20, 2024
e929462
Add empty migration
margrietpalm Nov 21, 2024
0f37a7a
Add header to changes
margrietpalm Nov 21, 2024
5af51d7
Merge branch 'master' into margriet_schema_300_leftovers
margrietpalm Nov 25, 2024
77f1cac
Remove leftover indices (#137)
margrietpalm Nov 26, 2024
287b6db
Remove left over references in geometry columns (#139)
margrietpalm Nov 26, 2024
aae9bfc
Change name of table tags to tag (#140)
margrietpalm Nov 26, 2024
d4b8bdb
Merge branch 'master' into margriet_schema_300_leftovers
margrietpalm Nov 26, 2024
e19b358
Make model_settings.use_2d_rain and model_settings.friction_averaging…
margrietpalm Nov 28, 2024
bad4638
Fix use tables (#145)
margrietpalm Dec 2, 2024
2d6eea9
Merge branch 'master' into margriet_schema_300_leftovers
margrietpalm Dec 4, 2024
2cf5c45
Merge branch 'master' into margriet_schema_300_leftovers
margrietpalm Dec 4, 2024
e38c1e9
Improve migration performance for 223 (#148)
margrietpalm Dec 4, 2024
5745c1d
Remove foreign key requirements that were missed before
margrietpalm Dec 5, 2024
3250ee8
switch surface dwf map geom direction (#151)
margrietpalm Dec 10, 2024
8cc717a
Sanitize comma separated fields (#152)
margrietpalm Dec 10, 2024
80fa723
Fix sanitize comma separated fields (#154)
margrietpalm Dec 10, 2024
bc199c9
Merge branch 'master' into margriet_schema_300_leftovers
margrietpalm Dec 10, 2024
36615fb
Remove view (#156)
margrietpalm Dec 17, 2024
81731fd
Remove usage of ORM from migrations 228 and 229 (#158)
margrietpalm Dec 17, 2024
f926ee8
Fix typo
margrietpalm Dec 17, 2024
88471a9
Bump versions
margrietpalm Dec 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,17 @@ Changelog of threedi-schema



0.228.4 (unreleased)
0.229.0 (unreleased)
--------------------

- Nothing changed yet.
- Rename sqlite table "tags" to "tag"
- Remove indices referring to removed tables in previous migrations
- Make model_settings.use_2d_rain and model_settings.friction_averaging booleans
- Remove columns referencing v2 in geometry_column
- Ensure correct use_* values when matching tables have no data
- Use custom types for comma separated and table text fields to strip extra white space
- Correct direction of dwf and surface map
- Remove v2 related views from sqlite


0.228.3 (2024-12-10)
Expand Down
2 changes: 1 addition & 1 deletion threedi_schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
from .domain import constants, custom_types, models # NOQA

# fmt: off
__version__ = '0.228.4.dev0'
__version__ = '0.229.0.dev0'

# fmt: on
47 changes: 46 additions & 1 deletion threedi_schema/domain/custom_types.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import re

import geoalchemy2
from packaging import version
from sqlalchemy.types import Integer, TypeDecorator, VARCHAR
from sqlalchemy.types import Integer, Text, TypeDecorator, VARCHAR


class Geometry(geoalchemy2.types.Geometry):
Expand Down Expand Up @@ -66,6 +68,49 @@ class IntegerEnum(CustomEnum):
impl = Integer


def clean_csv_string(value: str) -> str:
return re.sub(r"\s*,\s*", ",", value.strip())


class CSVText(TypeDecorator):
impl = Text
cache_ok = True

def process_bind_param(self, value, dialect):
if value is not None:
value = clean_csv_string(value)
return value

def process_result_value(self, value, dialect):
if value is not None:
value = clean_csv_string(value)
return value


def clean_csv_table(value: str) -> str:
# convert windows line endings to unix first
value = value.replace("\r\n", "\n")
# remove leading and trailing whitespace
value = value.strip()
# clean up each line
return "\n".join([clean_csv_string(line) for line in value.split("\n")])


class CSVTable(TypeDecorator):
impl = Text
cache_ok = True

def process_bind_param(self, value, dialect):
if value is not None:
value = clean_csv_table(value)
return value

def process_result_value(self, value, dialect):
if value is not None:
value = clean_csv_table(value)
return value


class VarcharEnum(CustomEnum):
cache_ok = True
impl = VARCHAR
Loading
Loading