Moonstream database
Project description
moonstream db
Setting up moonstreamdb
Copy sample.env
to a new file and set the environment variables to appropriate values. This new file
should be sourced every time you want to access the database with the moonstreamdb
application or any
dependents.
To be able to run migrations, copy alembic.sample.ini
to a separate file
(e.g. ./secrets/alembic.dev.ini
) and modify the sqlalchemy.url
setting in the new file to point
at your database.
Make sure your database is at the latest alembic migration:
alembic -c ./secrets/alembic.dev.ini upgrade head
Adding a new table to database
Add SQLAlchemy model in moonstreamdb/models.py
Import new model and add tablename to whitelist in alembic/env.py
Create a migration:
alembic -c <alembic config file> revision -m "<revision message>" --autogenerate
Always check the autogenerated file to make sure that it isn't performing any actions that you don't want it to. A good policy is to delete any operations that don't touch the tables that you created.
Then run the migration:
alembic -c <alembic config file> upgrade head
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file moonstreamdb-0.4.5.tar.gz
.
File metadata
- Download URL: moonstreamdb-0.4.5.tar.gz
- Upload date:
- Size: 12.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 253f289fd9290c30c1239bd6f49da83deba6166d6e7497edace70d97bab5aaa7 |
|
MD5 | 4681b457cb54448207df91d3b3c845a2 |
|
BLAKE2b-256 | 26f61e320db63896bd0d4e4654fc6fde9d5c63d5dd871239ab9eb9f77c538b24 |
File details
Details for the file moonstreamdb-0.4.5-py3-none-any.whl
.
File metadata
- Download URL: moonstreamdb-0.4.5-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 224ee1a8281037cf56e745aee7fb5727cec147d0a93cef4cd76c1be6a9fb3751 |
|
MD5 | a8479ee530ada4ebf5b2424928ef5dc5 |
|
BLAKE2b-256 | 9dd46893d6d14755c2d3891582a25896b20a4a6605567bc3a6731cead08bae7c |