anisotropy/docs/source/notes/database.rst
L-Nafaryus 193e1991f4
New: cli command 'query'
Remove: unknown trash
Mod: database micro migration
2021-09-06 17:00:15 +05:00

26 lines
595 B
ReStructuredText

Database hierarchy
==================
Current anisotropy database hierarchy:
.. figure:: ../static/er-diagram.png
:align: center
peewee migration
----------------
Example of Sqlite database migration and etc:
.. code-block:: python
from playhouse.migrate import SqliteMigrator, migrate
from peewee import SqliteDatabase, FloatField
db = SqliteDatabase("anisotropy.db")
migrator = SqliteDatabase(db)
migrate(
migrator.rename_column("MeshResult", "status", "meshStatus"),
migrator.add_column("FlowResult", "porosity", FloatField(null = True))
)