Initialize a new Akron project with schema configuration and migration setup.
Initialize a new Akron project with schema configuration file and migration directory structure.
Option | Description | Default |
---|---|---|
--provider | Database provider (sqlite, mysql, postgresql, mongodb) | sqlite |
--url | Custom database connection URL | Provider default |
--force | Overwrite existing akron.json file | false |
Initialize a new project with SQLite database (default):
ā Initialized Akron project Provider: sqlite Database: sqlite:///app.db Schema file: akron.json š Next steps: 1. Edit akron.json to define your schema 2. Run 'akron db makemigrations' to generate migrations 3. Run 'akron db migrate' to apply migrations
Initialize with PostgreSQL and custom connection URL:
ā Initialized Akron project Provider: postgresql Database: postgres://user:password@localhost:5432/myapp Schema file: akron.json š Next steps: 1. Edit akron.json to define your schema 2. Run 'akron db makemigrations' to generate migrations 3. Run 'akron db migrate' to apply migrations
Overwrite existing configuration:
ā Initialized Akron project Provider: mysql Database: mysql://user:password@localhost:3306/database Schema file: akron.json š Next steps: 1. Edit akron.json to define your schema 2. Run 'akron db makemigrations' to generate migrations 3. Run 'akron db migrate' to apply migrations
The main schema configuration file:
Migration tracking directory structure:
Provider | Default URL | Notes |
---|---|---|
sqlite | sqlite:///app.db | Creates local file database |
mysql | mysql://user:password@localhost:3306/database | Update credentials before use |
postgresql | postgres://user:password@localhost:5432/database | Update credentials before use |
mongodb | mongodb://localhost:27017/database | Default local MongoDB |
akron.json
to define your database schemaakron db makemigrations
to generate initial migrationsakron db migrate
to create your database tables