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

372 Refactor migrate and migrate unique constraints on model.ref #491

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
6cf716c
372 Part of the refactored migrate
adp-atea Jul 4, 2023
47a4664
372 Added foreign key handle (not finished)
adp-atea Jul 5, 2023
20328ee
372 Added foreign key constraints and base
adp-atea Jul 10, 2023
48ac7ac
372 Fixed foreign key remove
adp-atea Jul 10, 2023
ece9a9c
372 Added File type migration
adp-atea Jul 10, 2023
26b339c
372 Fixed a bug, added index
adp-atea Jul 11, 2023
a3eccd3
372 Added rename file validation, some tests
adp-atea Jul 13, 2023
edb6cb3
372 Fixed postgresql db for testing, added more tests
adp-atea Jul 13, 2023
9fa45ba
372 Added groundwork for array and object types
adp-atea Jul 14, 2023
092bfe5
372 Fixed bugs, added more tests
adp-atea Jul 17, 2023
6634139
372 changed db
adp-atea Jul 17, 2023
b30d0a0
372 added table cleanup
adp-atea Jul 17, 2023
9e2c8d1
372 Fixed test time and geometry
adp-atea Jul 17, 2023
669d59c
372 Fixed geometry and moved migrate tests to posgresql
adp-atea Jul 17, 2023
d0623ab
372 Fixed drop schema
adp-atea Jul 17, 2023
911a56d
372 Renamed inspect_test.py rc fixture
adp-atea Jul 17, 2023
7cbe68e
372 fixed refactoring
adp-atea Jul 17, 2023
7b493ee
372 fixed refactoring
adp-atea Jul 17, 2023
5e5f5d3
372 fixed old test
adp-atea Jul 17, 2023
51a72c4
372 changed db for tests
adp-atea Jul 18, 2023
1198827
372, 432 added indexes to foreign keys
adp-atea Jul 19, 2023
fcf874b
Testing notes
sirex Aug 18, 2023
8c4f3c7
Merge branch 'master' into 372-refactor-migrate-and-migrate-unique-co…
adp-atea Nov 17, 2023
4598ebc
372 bug fixes, added autocommit
adp-atea Nov 20, 2023
a56c575
372 added null check
adp-atea Nov 21, 2023
fd6f2a2
Merge branch 'master' into 372-refactor-migrate-and-migrate-unique-co…
adp-atea Nov 21, 2023
49dc52c
372 fixed text
adp-atea Nov 21, 2023
091dffa
372 fixed migration test
adp-atea Nov 21, 2023
93a2b6c
Merge branch 'master' into 372-refactor-migrate-and-migrate-unique-co…
adp-atea Jan 22, 2024
4263325
372 removed empty test file
adp-atea Jan 22, 2024
f484495
372 merge test fix
adp-atea Jan 22, 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
50 changes: 50 additions & 0 deletions notes/cli/migrate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# notes/docker.sh Start docker compose
# notes/postgres.sh Reset database

INSTANCE=cli/migrate
DATASET=$INSTANCE
# notes/spinta/server.sh Configure server

git clone https://github.com/atviriduomenys/manifest.git ../manifest
git -C ../manifest status
git -C ../manifest co master
git -C ../manifest pull
git -C ../manifest log --oneline -n 100 | grep Merge
git -C ../manifest co 20959140

export BASEDIR=$PWD/var/instances/$INSTANCE
export SPINTA_CONFIG=$BASEDIR/config.yml

poetry shell
cd ../manifest
cat get_data_gov_lt.in | xargs spinta copy -o $BASEDIR/manifest.csv
exit

poetry run spinta --tb=native check $BASEDIR/manifest.csv
#| Traceback (most recent call last):
#| File "spinta/cli/config.py", line 35, in check
#| prepare_manifest(context, ensure_config_dir=True)
#| File "spinta/cli/helpers/store.py", line 138, in prepare_manifest
#| commands.prepare(context, store.manifest)
#| File "spinta/manifests/commands/init.py", line 14, in prepare
#| commands.prepare(context, backend, manifest)
#| File "spinta/backends/postgresql/commands/init.py", line 24, in prepare
#| commands.prepare(context, backend, model)
#| File "spinta/backends/postgresql/commands/init.py", line 53, in prepare
#| main_table = sa.Table(
#| ^^^^^^^^^
#| File "sqlalchemy/sql/schema.py", line 3302, in _set_parent
#| ColumnCollectionMixin._set_parent(self, table)
#| File "sqlalchemy/sql/schema.py", line 3259, in _set_parent
#| for col in self._col_expressions(table):
#| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#| File "sqlalchemy/sql/schema.py", line 3253, in _col_expressions
#| return [
#| ^
#| File "sqlalchemy/sql/schema.py", line 3254, in <listcomp>
#| table.c[col] if isinstance(col, util.string_types) else col
#| ~~~~~~~^^^^^
#| File "sqlalchemy/sql/base.py", line 1192, in __getitem__
#| return self._index[key]
#| ~~~~~~~~~~~^^^^^
#| KeyError: 'aob_kodas.aob_kodas'
adp-atea marked this conversation as resolved.
Show resolved Hide resolved
Loading
Loading