-
Notifications
You must be signed in to change notification settings - Fork 24
Move Makefile #384
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
Open
Janmtbehrens
wants to merge
203
commits into
main
Choose a base branch
from
move-makefile-reldb
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Move Makefile #384
Changes from all commits
Commits
Show all changes
203 commits
Select commit
Hold shift + click to select a range
3521912
WIP: relational schema generation 1
090858f
intermediate commit
9551dd2
main merged
7346c76
files moved to new destinations
449bf0a
first doc and working for debugger
d1dd8d7
Merge branch 'main' into generate_relational_db_schema
90dee01
shorten projector. used_as_default_projector_for_current_list_of_spe…
a9a028a
table- and field-names moved to helper_get_names.py
f59d7d1
all constraint names to build in helper_get_names
7f73d36
added .gitignore
1ffc8dc
last name get methos (?)
e569cda
removed primary attribute
d33c92c
fix error DEFAULT with empty enum list
dff00aa
schema.sql to schema_relational.sql in text
59e452f
make target generate-relational-schema
8a740ed
makefile commands db handling
308f3a1
use psycopg-binaray for dev
d80fefd
Merge branch 'main' into generate_relational_db_schema
d5e43e2
Apply database schema on starting dev container
2d17230
merge main
25947b6
intermediate with postgres function truncate_tables for test setup, c…
b8fd2c3
deployable schema and test with some data initialized
ed40049
Merge branch 'main' into generate_relational_db_schema
737d98f
workflow_states defined, common data test-setup in db-template ready
2c35082
tests for generic and 1:1 relation plus fixes
0839b27
create_meeting-method
8116b90
Install postgres debugger as deb package
baa1c0b
Implement 1:n relations, where the n-side is required via trigger
6456c24
debug capabilities, some new attributes and 1 dummy
e2988da
Some setup fixes
jsangmeister b0f6856
fix formal checks
171f02d
better documented models.yml
50d0b39
Disable model.yml validation in CI
jsangmeister f1b19a2
Merge pull request #61 from jsangmeister/setup-fixes
jsangmeister 11fc904
add *.code-workspace to gitignore
6a61d07
intermediate checks
1db9010
draft: started get relation letters in check_relation_definitions
5a23cf2
Merge branch 'main' into feature/relational-db
jsangmeister 6e825eb
merge main/feature
a5c7bac
fix some small errors in models.yml
70983bf
add .gitignore
cf80722
Merge branch 'feature/relational-db' into generate_relational_db_schema
156b6ea
models.yml fixed with all needed reference attributes
3db9ee8
add check for existing to-attribute if reference is present
6438beb
Apply PR65 readd 'to' relation fields
647fd81
escape ' in comment
583ef7a
define fields organization_id automatically as number with value 1
861f75d
remove unnecessary elements from decision list
65f17da
readd .gitignore
f9c7f78
fix annotations from code review
275ff68
fix format eror
1d0c410
Merge pull request #17 from r-peschke/generate_relational_db_schema
8581da5
change table names: use appendix "_t"
6d8395f
Merge pull request #71 from r-peschke/relDB-change_table_names
5a9094c
sql only in relation, better error reporting
5f3735c
Merge pull request #73 from r-peschke/I13_fix_sql_signification
6d05b70
Merge `main` into `feature/relational-db`
jsangmeister f8e5d54
Fix close issues action
jsangmeister 3c1be82
Merge pull request #75 from jsangmeister/fix-close-issues
jsangmeister 8a9d693
Fix close issues
jsangmeister 3f279f9
Merge pull request #76 from jsangmeister/fix-close-issues
jsangmeister 13b4653
Fix close issues
jsangmeister 5d0823d
Merge pull request #77 from jsangmeister/fix-close-issues
jsangmeister 6439e54
enum checking in constraint instead pg enums (only string)
e4641fb
convert enums to constraints and colors to strings
cb70d6d
Merge pull request #80 from r-peschke/I13_enums_and_hex
e4c02dc
use python-sql for generating sql
7203c19
Fix models & rudimentary validation
jsangmeister ba658f8
Re-enable CI
jsangmeister 9cef28f
Fix models
jsangmeister e509878
Comment out unfinished SQL statements
jsangmeister 98307c5
Revert relation change
jsangmeister 61a9e48
fix hints from code review
7e253f4
Add support for self-referencing relations
jsangmeister b3cfeb6
fix hints from code review 2
936d185
Merge pull request #84 from jsangmeister/fix-models
jsangmeister fae58a6
Merge branch 'feature/relational-db' into add-identical-motion-ids
jsangmeister b6da76d
Merge pull request #85 from jsangmeister/add-identical-motion-ids
jsangmeister 33f340d
Merge branch 'main' into feature/relational-db
jsangmeister 06f6a73
merge feature/relational-db
6da629c
fix import helper_get_names
572111f
Merge pull request #83 from r-peschke/I13_python_sql_replaces_psycopg…
78d720e
Merge main into feature branch
6b090c8
Merge pull request #92 from r-peschke/feature/relational-db
dc13061
Merge branch 'main' into feature/relational-db
e7433f6
Merge pull request #98 from r-peschke/feature/relational-db
9077385
Ch attribute set is_view_field
reicda de6e58a
Merge branch 'main' into feature/relational-db
59b4f26
Merge pull request #105 from r-peschke/feature/relational-db
7d6ccb1
implemented get view field and write field method
reicda 41c2e71
Merge branch 'main' into feature/relational-db
e563c46
Moved functions to helper_get_names
reicda dc2275e
Merge pull request #102 from reicda/2311-dr-dev-branch-rel-db
reicda 4aa5adc
Merge branch 'main' into feature/relational-db
f20bd7d
Merge branch 'main' into feature/relational-db
daf124f
Merge remote-tracking branch 'upstream/main' into feature/relational-db
312dad9
make CREATE EXTENSION idempotent
13962d8
Merge pull request #130 from r-peschke/make_create_extension_idempotent
f6edd38
merge main into feature/relational-db
e61d605
Add reference for foreign key to field meeting/anonymous_group_id
74824dd
Merge pull request #150 from r-peschke/Add_reference_to_meeting_anony…
717cb1c
Fix import and generate new relational schema
84da921
Merge pull request #152 from r-peschke/Fix_import_into_generate_sql_main
24f09dc
remove idempotency from relational schema (should always be done by m…
70d4e8f
fix formatting
40525cc
Merge pull request #153 from r-peschke/remove_idempotency_of_rel_schema
7d87d03
version upgrade python-sql package to 1.5.1
d1e7daa
Merge pull request #154 from r-peschke/refresh-python-sql-1.5.1
ab81ad9
Remove function truncate_tables from relational schema generation
f3ea624
Merge pull request #156 from r-peschke/remove_funtion_truncate_tables…
694aaa8
set all FK to INITIALLY DEFERRED
reicda eaa6519
cleanup
reicda 8f03d2c
Merge pull request #159 from reicda/set-all-foreign-key-contraints-to…
452a40b
merge main into feature/relational-db
a9deb5a
Merge branch 'main' into feature/relational-db
0461b60
main merge with fixes, generate field_name for nm-table_name from ini…
163343e
newly generated schema_relational.sql
f87debb
remove tailing _t from nm- and gm-table names in schema generation
40757a7
Merge pull request #173 from r-peschke/I171_intermediate_tables_witho…
6e3fce0
NOTIFY trigger (#212)
peb-adr 60a52d2
Merge remote-tracking branch 'upstream/main' into HEAD
ostcar 760ffa4
Generate schema after merge
ostcar c45d201
Fix decimal type (#248)
ostcar 39c09d4
Send notifications on transaction commit (#249)
rrenkert 55930d1
Merge remote-tracking branch 'upstream/main' into feature/relational-db
ostcar 39a3824
Set views in quotes. (#250)
ostcar bce10cf
Add/Fix file with init data (#251)
ostcar 0195595
remove _t from table name in notification to get correct fqid (#252)
LinKaKling 8c03c46
update trigger and functions (#254)
rrenkert 1106164
Generate views for all collections (#255)
hjanott 0eb36c4
[rel-db] Initially defer and use correct field in nm gm (#263)
hjanott 5b903a6
Add cascading delete to intermediate tables (#271)
hjanott 5cbb361
Unique keyword for 1:1 relations (#272)
hjanott ced8eb5
give ordered output on view relation lists (#273)
hjanott 332013b
use custom sql for relations of user with committee and meeting (#277)
hjanott 7fa0add
merge upstream main
hjanott 7604835
Fix and unify the sql attributes
ostcar 839fb55
Change models.yml for new vote service based on rel-db
ostcar 07cd4c7
generate sql
ostcar c7071cf
[rel-db] Double precision (#286)
hjanott 13c0ca5
[Rel-DB] Fix and unify the sql attributes (#288)
ostcar 96d6204
move analog from visibility to method
ostcar a8c09b6
Merge remote-tracking branch 'upstream' into HEAD
hjanott 59c42d3
generate schema
hjanott a45bb6d
cleanups
ostcar 05aac25
Merge branch 'main' into feature/relational-db
ostcar 13ee685
Fix sql comments with quotes (#292)
hjanott dd23ffc
Related models notification log trigger (#256)
LinKaKling 39e3d28
[rel-db] Handle relational fields referencing themselves (#293)
vkrasnovyd 87fd8a6
Merge remote-tracking branch 'upstream/feature/relational-db' into fe…
ostcar 10a6f4e
Move analog back to visibility
ostcar 41c15d0
poll/result is not required
ostcar 076ab67
Update sql
ostcar 41c23bb
Vote can be any text
ostcar 0896755
Merge remote-tracking branch 'upstream/main' into feature/relational-db
ostcar a26b45d
[rel-db] Remove option from base_data (#305)
ostcar cfb9ff2
Merge remote-tracking branch 'upstream/feature/relational-db' into fe…
ostcar cbe528f
make poll/config and poll/request text fields
ostcar 6d5c2ac
Add field live_voting_enabled
ostcar b940876
[rel-db] Update sequences after insert (#312)
rrenkert 5b34950
Add references to history collections (#311)
rrenkert f96efec
restriciton modes and new publish system
ostcar 1067e1d
Merge remote-tracking branch 'upstream/feature/relational-db' into fe…
ostcar 5fc2e68
make allow_invalid a separat attribute
ostcar f47728e
[rel-db] Introduce more relations/constraints / change handling of MO…
hjanott b2e83a1
Improve check_not_null_for_relation_lists trigger (#308)
vkrasnovyd 63552b9
Merge remote-tracking branch 'upstream/feature/new-vote-service' into…
ostcar 76186e5
Merge branch 'feature/new-vote-service' into feature/relational-db
ostcar 26540c6
Move gender to base_data
ostcar 9357b13
Remove relation from vote to meeting.
ostcar 4f12429
Move vote/*_user_id in its own restriction mode
ostcar 77f9928
Rename values of poll/method
ostcar d512fa2
vote_split
ostcar 3126139
Fix related Models Notification to be always 'update' (#334)
LinKaKling 882048c
Move poll/voted_ids to restriction_mode B
ostcar eb7e9f2
Remove setting log_min_messages (#335)
rrenkert 54491cc
[rel-db] add sequential numbers before insert (#319)
hjanott acdf857
[rel-db] Add poll_config_X-collections (#338)
ostcar a13f31d
New way to vote vor a list of candidates or other optons (#341)
ostcar 3de5240
Merge remote-tracking branch 'upstream/main' into feature/relational-db
ostcar 0d0c670
Remove vote (#343)
ostcar 4a8a43a
[rel-DB] Merge main (#355)
vkrasnovyd 7c7e3a4
Merge branch 'main' into feature/relational-db
rrenkert bad6126
Re-add test data for --rl:gr (#349)
vkrasnovyd 96ae121
Merge remote-tracking branch 'upstream/main' into feature/relational-db
rrenkert bc648c8
Implement TextArrayField (#361)
vkrasnovyd 68c9bc4
Merge remote-tracking branch 'upstream/main' into feature/relational-db
ostcar 5baa08e
generate models.yml
ostcar 20143fa
Merge remote-tracking branch 'upstream/main' into feature/relational-db
ostcar b97fe64
[rel-db] Add version table (#333)
hjanott 0f4dab1
Fix merge commit '68c9bc4' (#375)
rrenkert fc4f3fe
[rel-DB] Add nt:ntR relation and n:m not_null trigger (#376)
vkrasnovyd 2c58ca5
[rel-db] Add CREATE INDEX and update custom SQLs (#378)
rrenkert d0cc2af
[rel-DB] Fix check_not_null_for_n_m() (#377)
vkrasnovyd 3ee58d1
[rel-DB] Isolate rows for user.committee_ids calculation (#381)
vkrasnovyd 7ad7d26
Moving makefile and adjusting references to its maketargets
Janmtbehrens ee16c02
Change Workflow CI environment to root
Janmtbehrens 0a022d0
Adjusted hard coded paths in Makefile
Janmtbehrens c2f5a0d
Adjusted paths again. Moved .sqlfuffignore
Janmtbehrens 46400c0
Calling isort on base.py and test_generic_relations.py
Janmtbehrens 16bfcf4
Add dev to appy-test-data target
Janmtbehrens 18558cc
Adjusting run-dev
Janmtbehrens 9e0be22
Add -f flag to dev-stop
Janmtbehrens File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: Test SQL | ||
| on: [pull_request] | ||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| # TODO: What container should be used? This is from the github example | ||
| container: node:20-bookworm-slim | ||
|
|
||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_PASSWORD: password | ||
| POSTGRES_USER: openslides | ||
| POSTGRES_DB: openslides | ||
| options: >- | ||
| --health-cmd pg_isready | ||
| --health-interval 10s | ||
| --health-timeout 5s | ||
| --health-retries 5 | ||
|
|
||
| steps: | ||
| - name: Check out code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install psql | ||
| run: | | ||
| apt-get update | ||
| apt-get install --yes --no-install-recommends postgresql-client | ||
|
|
||
| - name: apply schema | ||
| shell: bash | ||
| run: bash dev/scripts/apply_db_schema.sh | ||
| env: | ||
| DATABASE_HOST: postgres | ||
| DATABASE_PORT: 5432 | ||
| DATABASE_USER: openslides | ||
| DATABASE_NAME: openslides | ||
| PGPASSWORD: password | ||
|
|
||
| - name: insert base data | ||
| shell: bash | ||
| run: bash dev/scripts/apply_data.sh base_data.sql | ||
| env: | ||
| DATABASE_HOST: postgres | ||
| DATABASE_PORT: 5432 | ||
| DATABASE_USER: openslides | ||
| DATABASE_NAME: openslides | ||
| PGPASSWORD: password | ||
|
|
||
| - name: insert test data | ||
| shell: bash | ||
| run: bash dev/scripts/apply_data.sh test_data.sql | ||
| env: | ||
| DATABASE_HOST: postgres | ||
| DATABASE_PORT: 5432 | ||
| DATABASE_USER: openslides | ||
| DATABASE_NAME: openslides | ||
| PGPASSWORD: password |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| # Patterns of intentionally untracked files that Git should ignore | ||
|
|
||
| # Private development data | ||
| private/ | ||
|
|
||
| # Python compiled files | ||
| __pycache__/ | ||
|
|
||
| # Python virtual environment target directory | ||
| .virtualenv/ | ||
| .venv/ | ||
|
|
||
| # Mypy (static type checker) cache | ||
| .mypy_cache/ | ||
|
|
||
| # Pytest, pytest-cov and Coverage.py cache | ||
| .pytest_cache/ | ||
| .coverage | ||
| htmlcov/ | ||
|
|
||
| # Specific editor files | ||
| .vscode/* | ||
| .vimrc | ||
|
|
||
| # coverage | ||
|
|
||
| migrations/*.json | ||
| migrations/*.sql | ||
|
|
||
| # secrets | ||
| secrets/ | ||
|
|
||
| # code-workspaces | ||
| *.code-workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| schema_relational.sql |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| # Commands inside the container | ||
| paths = dev/src/ dev/tests/ | ||
|
|
||
| all: pyupgrade black autoflake isort flake8 mypy sqlfluff | ||
|
|
||
| pyupgrade: | ||
| pyupgrade --py310-plus --exit-zero-even-if-changed $$(find . -name '*.py') | ||
|
|
||
| check-pyupgrade: | ||
| pyupgrade --py310-plus $$(find . -name '*.py') | ||
|
|
||
| black: | ||
| black $(paths) | ||
|
|
||
| check-black: | ||
| black --check --diff $(paths) | ||
|
|
||
| autoflake: | ||
| autoflake $(paths) | ||
|
|
||
| isort: | ||
| isort $(paths) | ||
|
|
||
| check-isort: | ||
| isort --check-only --diff $(paths) | ||
|
|
||
| flake8: | ||
| flake8 $(paths) | ||
|
|
||
| mypy: | ||
| mypy dev/src/ | ||
|
|
||
| sqlfluff: | ||
| sqlfluff fix --dialect postgres --verbose | ||
|
|
||
| validate-models: | ||
| python -m dev.src.validate | ||
|
|
||
| generate-relational-schema: | ||
| python -m dev.src.generate_sql_schema | ||
|
|
||
| drop-database: | ||
| dropdb -f -e --if-exists -h ${DATABASE_HOST} -p ${DATABASE_PORT} -U ${DATABASE_USER} ${DATABASE_NAME} | ||
|
|
||
| create-database: | ||
| createdb -e -h ${DATABASE_HOST} -p ${DATABASE_PORT} -U ${DATABASE_USER} ${DATABASE_NAME} | ||
|
|
||
| apply-db-schema: | ||
| dev/scripts/apply_db_schema.sh | ||
|
|
||
| apply-test-data: | ||
| dev/scripts/apply_data.sh base_data.sql | ||
| dev/scripts/apply_data.sh test_data.sql | ||
|
|
||
| create-database-with-schema: drop-database create-database apply-db-schema | ||
|
|
||
| create-test-data: create-database-with-schema apply-test-data | ||
|
|
||
| run-psql: | ||
| psql -h ${DATABASE_HOST} -p ${DATABASE_PORT} -U ${DATABASE_USER} -d ${DATABASE_NAME} | ||
|
|
||
| # Docker manage commands | ||
|
|
||
| run-dev: | ||
| USER_ID=$$(id -u $${USER}) GROUP_ID=$$(id -g $${USER}) docker compose -f dev/docker-compose.yml up -d --build | ||
| docker compose -f dev/docker-compose.yml exec models bash --rcfile /etc/bash_completion | ||
|
|
||
| stop-dev: | ||
| docker compose -f dev/docker-compose.yml down | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.