You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an extension for the Laravel migrations. It is useful when you have a big database that results in a lot of migration files. This package will help you to reduce the number of migration files and furthermore it will give you a better structure with which you will have all schema updates for a table in one file.
6
6
@@ -9,7 +9,7 @@ This is an extension for the Laravel migrations. It is useful when you have a bi
9
9
Laravel Pro Migrations is distributed as a composer package. So you first have to add the package to your `composer.json` file:
10
10
11
11
```
12
-
"proai/laravel-pro-migrations": "~1.0"
12
+
"proai/laravel-super-migrations": "~1.0"
13
13
```
14
14
15
15
Then you have to run `composer update` to install the package.
@@ -20,12 +20,12 @@ Basically we don't define table builder schemas by migration, but by table. For
20
20
21
21
### Migration classes
22
22
23
-
Firstly here is a migration file in the `database/migrations` folder. Notice that we extend the `ProAI\ProMigrations\Migration` class. Instead of an `up()` and a `down()` method this class needs a `schemas()` method:
23
+
Firstly here is a migration file in the `database/migrations` folder. Notice that we extend the `ProAI\SuperMigrations\Migration` class. Instead of an `up()` and a `down()` method this class needs a `schemas()` method:
24
24
25
25
```php
26
26
<?php
27
27
28
-
use ProAI\ProMigrations\Migration;
28
+
use ProAI\SuperMigrations\Migration;
29
29
30
30
class InitProject extends Migration
31
31
{
@@ -61,15 +61,15 @@ The idea behind this is that one migration file includes all schemas for a whole
61
61
62
62
### Table classes
63
63
64
-
For each tablename that is returned by the `schemas()` method Laravel Pro Migrations searches for a php file in `database/migrations/tables` with the same name (i.e. for the table `users` there must exist a file `users.php`). This file must contain a class that extends `ProAI\ProMigrations\Table` and that is named after the table (in camel case) with a `Table` suffix. For example the classname must be `UsersTable` for a table `users`.
64
+
For each tablename that is returned by the `schemas()` method Laravel Pro Migrations searches for a php file in `database/migrations/tables` with the same name (i.e. for the table `users` there must exist a file `users.php`). This file must contain a class that extends `ProAI\SuperMigrations\Table` and that is named after the table (in camel case) with a `Table` suffix. For example the classname must be `UsersTable` for a table `users`.
65
65
66
66
Furthermore for each of the migration specific names that we declared in the migration file, the table class must declare a method with the same name (i.e. a `create` method for the users table). Here is a sample users table class that fits to the migration class from the previous section:
67
67
68
68
```php
69
69
<?php
70
70
71
71
use Illuminate\Database\Schema\Blueprint;
72
-
use ProAI\ProMigrations\Table;
72
+
use ProAI\SuperMigrations\Table;
73
73
74
74
class UserTable extends Table
75
75
{
@@ -93,15 +93,15 @@ class UserTable extends Table
93
93
94
94
```
95
95
96
-
We use `$this->upSchema()` and `$this->downSchema()` to define the up and down schema. These methods return a `ProAI\ProMigrations\Builder` instance that is similar to the Laravel database schema builder (see [Laravel docs](https://laravel.com/docs/5.3/migrations)). The only difference is that you don't need the tablename as first argument, because the tablename is already known.
96
+
We use `$this->upSchema()` and `$this->downSchema()` to define the up and down schema. These methods return a `ProAI\SuperMigrations\Builder` instance that is similar to the Laravel database schema builder (see [Laravel docs](https://laravel.com/docs/5.3/migrations)). The only difference is that you don't need the tablename as first argument, because the tablename is already known.
97
97
98
98
### Generator console commands
99
99
100
100
TODOC
101
101
102
102
## Support
103
103
104
-
Bugs and feature requests are tracked on [GitHub](https://github.com/proai/laravel-pro-migrations/issues).
104
+
Bugs and feature requests are tracked on [GitHub](https://github.com/proai/laravel-super-migrations/issues).
0 commit comments