Skip to content

Feature/relational db #1182

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

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from
Draft

Feature/relational db #1182

wants to merge 11 commits into from

Conversation

ostcar
Copy link
Member

@ostcar ostcar commented Apr 1, 2025

PR for the relational db feature.

To test it, use the following steps:

  1. Start Postgres
    docker run -it --rm --network host -e POSTGRES_USER=openslides -e POSTGRES_PASSWORD=openslides -e DATABASE_NAME=openslides postgres

  2. Add the schema
    You have to be in openslides-meta/dev/scripts
    DATABASE_HOST=localhost DATABASE_PORT=5432 DATABASE_USER=openslides DATABASE_NAME=openslides sh apply_db_schema.sh

  3. Build and start the autoupdate-service

go build
OPENSLIDES_PUBLIC_ACCESS_ONLY=1 OPENSLIDES_DEVELOPMENT=1 AUTH_FAKE=1 ./openslides-autoupdate-service

OPENSLIDES_PUBLIC_ACCESS_ONLY deactivates the connection to the vote-service
OPENSLIDES_DEVELOPMENT uses the default secred keys
AUTH_FAKE deactivates the connection to the vote serive (with the redis logout messagebus) and uses user id 1 for all connections

  1. Connect to database
    psql -h localhost -p 5432 -U openslides -d openslides

  2. Create User in database
    INSERT INTO "user" (id, username) values (1,'hugo');

5a. Make User a superadmin
UPDATE "user" SET organization_management_level='superadmin' WHERE id=1;

  1. Connect to Autoupdate
    curl localhost:9012/system/autoupdate?k=user/1/username

Currently, this is an early stage. Lots of stuff will probably not work

@ostcar ostcar marked this pull request as draft April 1, 2025 09:44
@ostcar ostcar self-assigned this Apr 1, 2025
@ostcar ostcar added the feature label Apr 1, 2025
@ostcar ostcar linked an issue Apr 8, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Database with postgres
1 participant