Skip to content

Commit 4047272

Browse files
committed
Rename to super migrations
1 parent 02b0eff commit 4047272

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Laravel Pro Migrations
22

3-
[![Latest Stable Version](https://poser.pugx.org/proai/laravel-pro-migrations/v/stable)](https://packagist.org/packages/proailaravel-pro-migrations) [![Total Downloads](https://poser.pugx.org/proai/laravel-pro-migrations/downloads)](https://packagist.org/packages/proai/laravel-pro-migrations) [![Latest Unstable Version](https://poser.pugx.org/proai/laravel-pro-migrations/v/unstable)](https://packagist.org/packages/proai/laravel-pro-migrations) [![License](https://poser.pugx.org/proai/laravel-pro-migrations/license)](https://packagist.org/packages/proai/laravel-pro-migrations)
3+
[![Latest Stable Version](https://poser.pugx.org/proai/laravel-super-migrations/v/stable)](https://packagist.org/packages/proailaravel-super-migrations) [![Total Downloads](https://poser.pugx.org/proai/laravel-super-migrations/downloads)](https://packagist.org/packages/proai/laravel-super-migrations) [![Latest Unstable Version](https://poser.pugx.org/proai/laravel-super-migrations/v/unstable)](https://packagist.org/packages/proai/laravel-super-migrations) [![License](https://poser.pugx.org/proai/laravel-super-migrations/license)](https://packagist.org/packages/proai/laravel-super-migrations)
44

55
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.
66

@@ -9,7 +9,7 @@ This is an extension for the Laravel migrations. It is useful when you have a bi
99
Laravel Pro Migrations is distributed as a composer package. So you first have to add the package to your `composer.json` file:
1010

1111
```
12-
"proai/laravel-pro-migrations": "~1.0"
12+
"proai/laravel-super-migrations": "~1.0"
1313
```
1414

1515
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
2020

2121
### Migration classes
2222

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:
2424

2525
```php
2626
<?php
2727

28-
use ProAI\ProMigrations\Migration;
28+
use ProAI\SuperMigrations\Migration;
2929

3030
class InitProject extends Migration
3131
{
@@ -61,15 +61,15 @@ The idea behind this is that one migration file includes all schemas for a whole
6161

6262
### Table classes
6363

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`.
6565

6666
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:
6767

6868
```php
6969
<?php
7070

7171
use Illuminate\Database\Schema\Blueprint;
72-
use ProAI\ProMigrations\Table;
72+
use ProAI\SuperMigrations\Table;
7373

7474
class UserTable extends Table
7575
{
@@ -93,15 +93,15 @@ class UserTable extends Table
9393

9494
```
9595

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.
9797

9898
### Generator console commands
9999

100100
TODOC
101101

102102
## Support
103103

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).
105105

106106
## License
107107

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"name": "proai/laravel-pro-migrations",
2+
"name": "proai/laravel-super-migrations",
33
"description": "This Laravel package is useful for big databases for a better migrations structure.",
44
"keywords": ["laravel","migrations","database", "table"],
5-
"homepage": "http://github.com/proai/laravel-pro-migrations",
5+
"homepage": "http://github.com/proai/laravel-super-migrations",
66
"license": "MIT",
77
"authors": [
88
{
@@ -16,12 +16,12 @@
1616
},
1717
"autoload": {
1818
"psr-4": {
19-
"ProAI\\ProMigrations\\": "src/"
19+
"ProAI\\SuperMigrations\\": "src/"
2020
}
2121
},
2222
"extra": {
2323
"branch-alias": {
2424
"dev-master": "1.0-dev"
2525
}
2626
}
27-
}
27+
}

src/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace ProAI\ProMigrations;
3+
namespace ProAI\SuperMigrations;
44

55
class Builder
66
{

src/Migration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace ProAI\ProMigrations;
3+
namespace ProAI\SuperMigrations;
44

55
use Illuminate\Database\Migrations\Migration as BaseMigration;
66

@@ -14,7 +14,7 @@ abstract class Migration extends BaseMigration
1414
protected $direction;
1515

1616
/**
17-
* Get class method names for up and down schemas.
17+
* Get table names and related methods for up and down schemas.
1818
*
1919
* @return array
2020
*/
@@ -65,7 +65,7 @@ protected function processSchemas()
6565
* Get an instance of a table schema.
6666
*
6767
* @param string $name
68-
* @return \ProAI\ProMigrations\Migration
68+
* @return \ProAI\SuperMigrations\Migration
6969
*/
7070
protected function getSchemaInstance($name)
7171
{

src/Table.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
namespace ProAI\ProMigrations;
3+
namespace ProAI\SuperMigrations;
44

5-
use ProAI\ProMigrations\Builder;
5+
use ProAI\SuperMigrations\Builder;
66

77
abstract class Table
88
{
@@ -16,7 +16,7 @@ abstract class Table
1616
/**
1717
* Pro migrations schema builder instance.
1818
*
19-
* @var \ProAI\ProMigrations\Builder
19+
* @var \ProAI\SuperMigrations\Builder
2020
*/
2121
private $schema;
2222

@@ -36,7 +36,7 @@ public function __construct($table, $direction)
3636
/**
3737
* Run the migrations.
3838
*
39-
* @return \ProAI\ProMigrations\Builder
39+
* @return \ProAI\SuperMigrations\Builder
4040
*/
4141
protected function upSchema()
4242
{

0 commit comments

Comments
 (0)