Commit a7a09200 authored by Tobias Munk's avatar Tobias Munk

update guide & help

parent b5999f38
......@@ -22,6 +22,7 @@
- [Application Console](development/console.md)
- [Web-backend](development/backend.md)
- [Web-frontend](development/frontend.md)
- [Logging](tutorials/logging.md)
- [Extensions](development/extensions.md)
- [Conventions](development/conventions.md)
- [Troubleshooting](development/troubleshooting.md)
......@@ -48,7 +49,6 @@
- [Develop vendor extensions with git repositories](tutorials/extension-development.md)
- [Update application packages](tutorials/composer-update-packages.md)
- [Upgrading applications](tutorials/upgrading.md)
- [Logging](tutorials/logging.md)
##### Assets
......
Example for storing database dumps on S3.
yii db/export && \
yii fs/sync runtime://mysql s3:// --interactive=0 && \
yii fs/rmdir runtime://mysql --recursive --interactive=0
-----
Transfer data from staging to migrations
- Go to `/resque`
- `yii db/x-dump/data`
- Download (via Moxiemanager or Filyfly)
- Create file migration, place into tests/codeception/_migrations/VERSION
- cd tests
- make clean all
- make run-tests (or make bash $ codecept run)
Production
==========
:warning: This section is under development.
### Migrate production data sets
- Do not export the schema (experimental: use `yii db/x-dump-data`)
- Don't export the data of tables such as
- log
- migration
- language
- auth
- Use correct time in migration history
- minimize the number of `dev-master` packages
# Database migrations
### Database migrations
> :bulb: It is recommended to keep structural (schema) and data-only migrations separated.
> :bulb: It is recommended to keep structural and data migrations separated.
Lookup paths for migrations can be defined in application configuration, for details see [dmstr/yii2-migrate-command](https://github.com/dmstr/yii2-migrate-command/blob/master/README.md).
## Development data
'params' => [
'yii.migrations' => [
'@yii/rbac/migrations',
'@dektrium/user/migrations',
'@vendor/lajax/yii2-translate-manager/migrations',
'@bedezign/yii2/audit/migrations'
### Configuration
Configure migrate command with predefined values *use only for creating file migrations*
'controllerMap' => [
'file:migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'templateFile' => '@vendor/dmstr/yii2-db/db/mysql/templates/file-migration.php',
'migrationPath' => '@project/migrations/dev-data',
]
]
],
### Usage
- Create the database export, which is basically an adjusted dump
> yii db/export --outputPath=@project/migrations/dev-data
> :exclamation: The dump truncates all exported tables by default
- Create a migration
> yii file:migrate/create dev_data
### Create a database migration from a SQL file
- Adjust `public $file = '<NAME_OF_YOUR_EXPORTED_FILE>.sql';` in the newly created migration.
yii migrate/create \
--templateFile='@dmstr/db/mysql/templates/file-migration.php' \
--migrationPath='@app/migrations/demo-data' \
data_migration
- For development add the development-data migrations via ENV variable in `docker-compose.dev.yml`
Do not forget to add the migration path to the configuration
APP_MIGRATION_LOOKUP=@project/migrations/dev-data
'params' => [
## Additional information
If you create initial data for the application, which is required and should always be inserted in inital setup, do not forget to add the migration path to the configuration
'params' => [
'yii.migrations' => [
'@app/migrations/demo-data',
'@app/migrations/data',
]
]
:green_book: https://github.com/dmstr/yii2-db/blob/master/README.md
Lookup paths for migrations can be defined in application configuration, for details see [dmstr/yii2-migrate-command](https://github.com/dmstr/yii2-migrate-command/blob/master/README.md).
### Commands
'params' => [
'yii.migrations' => [
'@yii/rbac/migrations',
'@dektrium/user/migrations',
'@vendor/lajax/yii2-translate-manager/migrations',
'@bedezign/yii2/audit/migrations'
]
]
Configure migrate command with predefined values *use only for creating file migrations*
## Resources
'controllerMap' => [
'file:migrate' => [
'class' => 'yii\console\controllers\MigrateController',
'templateFile' => '@vendor/dmstr/yii2-db/db/mysql/templates/file-migration.php',
'migrationPath' => '@app/modules/_migrations/demo-data',
]
],
:green_book: https://github.com/dmstr/yii2-db/blob/master/README.md
......@@ -3,11 +3,7 @@
As an ephemeral container, a *phd5* application usually does not store files directly.
It requires one or more storage backends, which are used for permanent file storage.
Example for storing database dumps on S3.
yii db/export && \
yii fs/sync runtime://mysql s3:// --interactive=0 && \
yii fs/rmdir runtime://mysql --recursive --interactive=0
yii fs --help
# SEO
## Pages
'defaultRoute' => 'site/root-node',
......@@ -28,3 +28,41 @@ Setup
Configuration
-------------
*TBD*
```
{
"repositories": [
{
"type": "vcs",
"url": "file:///repo/schmunk42/yii2-giiant"
}
],
"require": {
"wikimedia/composer-merge-plugin": "~1.4",
"schmunk42/yii2-giiant": "dev-develop"
},
"extra": {
"merge-plugin": {
"require": [
"/app/composer.json",
"/repo/schmunk42/yii2-giiant/composer.json"
]
}
},
"config": {
"fxp-asset": {
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
},
"vcs-driver-options": {
"github-no-api": true
},
"git-skip-update": "2 days",
"pattern-skip-version": "(-build|-patch)",
"optimize-with-installed-packages": false
}
}
}
```
\ No newline at end of file
......@@ -201,21 +201,24 @@ Enable **setting** `app.layout.enableTwigNavbar` and create a **prototype/twig**
> :warning: Be careful, when changing the navbar, see the **audit** module for your latest changes
{# Importing widgets namespaces and classes #}
{{ use('dmstr/modules/pages/models') }}
{{ use('rmrevin/yii/fontawesome') }}
{{ use('yii/helpers') }}
{{ use('yii/bootstrap') }}
{% set frontendItems = Tree.getMenuItems('root', true) %}
{# Prepare menu variables #}
{% set frontendItems = Tree.{# Importing widgets namespaces and classes #}getMenuItems('root', true) %}
{% set backendItems = Tree.getMenuItems('backend', true) %}
{# Navigation #}
{{ nav_bar_begin(
{
'brandLabel': FA.i('cog'),
}
) }}
{# Backend items #}
{{ nav_widget(
{
'options': {
......@@ -231,6 +234,7 @@ Enable **setting** `app.layout.enableTwigNavbar` and create a **prototype/twig**
}
) }}
{# Frontend items #}
{{ nav_widget(
{
'options': {
......@@ -240,6 +244,7 @@ Enable **setting** `app.layout.enableTwigNavbar` and create a **prototype/twig**
}
) }}
{# Logout #}
{{ nav_widget(
{
'options': {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment