headlight
A database migration toolkit.
Installation
Install headlight using PIP or poetry:
pip install headlight
# or
poetry add headlight
Features
- TODO
Usage
Create migration file
# create migration with
headlight new --name initial
It will create a new python file in migrations directory
Define schema
# migrations/0000_initial.py
from headlight import Blueprint, types
date = "2022-08-21T16:19:13.465195"
author = "alex"
transactional = True
def migrate(schema: Blueprint) -> None:
with schema.create_table('users') as table:
table.autoincrements()
table.add_column('first_name', types.VarCharType(256))
table.add_column('last_name', types.VarCharType(256))
table.add_column('email', types.VarCharType(256))
table.add_column('password', types.VarCharType(512))
table.add_column('active', types.BooleanType(), default='1')
table.add_column('photo', types.VarCharType(512), null=True)
table.add_column('deleted_at', types.DateTimeType(True), null=True)
table.add_created_timestamp('joined_at')
table.add_index(['(lower(email))'], unique=True)
Execute migration
headlight upgrade
All migrations will be applied to the database
Rollback migration
headlight downgrade
The last migration will be rolled back,
Metadata
Release files for headlight 0.1.14
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| headlight-0.1.14.tar.gz | 18.4 kB | Without provenance | Details for headlight-0.1.14.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| headlight-0.1.14-py3-none-any.whl | Python 3 | none | any | Details for headlight-0.1.14-py3-none-any.whl |
Total release size: 39.4 kB
Release files / headlight-0.1.14.tar.gz
| Download URL | headlight-0.1.14.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84a368d2b44e1f300e6ad809965cdc714ef2fe4856b8d10f30331680a8e60375
|
|
BLAKE2b-256 checksum How to use checksums |
b7b263e1ed9aaae42fa846dfef573e05d0f537d887be595cd84e6f2ce7130d74
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.10.7 Linux/5.19.13-arch1-1
|
Release files / headlight-0.1.14-py3-none-any.whl
| Download URL | headlight-0.1.14-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
54b21baea69bba2fa2f967d9d94fb1957aae847f163c658aadfaa107a76a8751
|
|
BLAKE2b-256 checksum How to use checksums |
7c7b1536c4971415175987bd60c65b1f676f45daed4fb23e7cace96571261480
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.2.1 CPython/3.10.7 Linux/5.19.13-arch1-1
|
Security for headlight 0.1.14
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.