Skip to content

Commit 4141be7

Browse files
committed
Merge branch 'release/1.0.0'
2 parents 4648d98 + 8d17aa7 commit 4141be7

File tree

5 files changed

+37
-25
lines changed

5 files changed

+37
-25
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# Created by .ignore support plugin (hsz.mobi)
2-
.idea
2+
/.idea
3+
/composer.lock
4+
/vendor

README.md

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,53 @@ laravel-schema-extend
22
=====================
33

44
- support MySQL 'table comment'.
5-
- 因为网上的不支持5.1以后的版本,所以自己改吧
6-
- 让 laravel 的 Schema 支持 MySQL “表注释”,5.1以后已经内置了列注释。
5+
- 'column comment' is built-in in greater than 5.1 version.
6+
- support variable length for integer/tinyint/mediumint/smallint/bigint
77

88
---
99

10-
> **不会对官方源码照成任何影响。**
11-
> 继承原生 schema,随源码更新。
10+
> just extend the original class
1211
1312

14-
## 使用前的准备
13+
## Install
1514

16-
composer.json 文件中申明依赖:
15+
Require this package with composer using the following command:
1716

18-
* support laravel 5.*
19-
```json
20-
"zedisdog/laravel-schema-extend": "~0.5"
17+
```bash
18+
composer require zedisdog/laravel-schema-extend
2119
```
2220

2321

24-
在配置文件 `config/app.php` 中替换“别名”
22+
modify the alias `Schema` in `config/app.php`:
2523

2624
```php
27-
'aliases' => array(
25+
'aliases' => [
2826
...
2927
// 'Schema' => Illuminate\Support\Facades\Schema::class,
30-
'Schema' => zedisdog\LaravelSchemaExtend\Schema::class,
31-
),
28+
'Schema' => Jialeo\LaravelSchemaExtend\Schema::class,
29+
],
3230
```
3331

34-
## 使用方法
32+
## Usage
3533

3634
```php
3735
Schema::create('tests', function ($table) {
38-
$table->increments('id')->comment('列注释');
39-
$table->comment = '表注释';
36+
//this is alredy built-in.
37+
$table->increments('id')->comment('column comment');
38+
39+
$table->integer('int')->default(1)->length(1);
40+
$table->bigInteger('big')->default(1)->length(1);
41+
$table->smallInteger('small')->default(1)->length(1);
42+
$table->tinyInteger('tiny')->default(1)->length(1);
43+
$table->mediumInteger('medium')->default(1)->length(1);
44+
45+
$table->comment = 'table comment';
4046
});
4147
```
4248

4349
## 致谢
4450

51+
- [jialeo](https://github.com/jialeo)
4552
- [ghostboyzone](https://github.com/ghostboyzone)
4653
- [xuhuan](https://github.com/xuhuan)
4754
- [xiaobeicn](https://github.com/xiaobeicn)

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name" : "zedisdog/laravel-schema-extend",
33
"type" : "library",
4-
"description" : "support MySQL 'table comment'.",
4+
"description" : "supplement for eloquent migration",
55
"authors" : [
66
{
77
"name": "zed",
@@ -11,10 +11,12 @@
1111
"require" : {
1212
"laravel/framework": "5.*"
1313
},
14-
"time" : "2015-11-16",
14+
"require-dev": {
15+
"phpunit/phpunit": "^5.0|^6.0"
16+
},
1517
"autoload" : {
16-
"psr-0" : {
17-
"zedisdog\\LaravelSchemaExtend" : "src/"
18+
"psr-4" : {
19+
"Jialeo\\LaravelSchemaExtend\\" : "src/"
1820
}
1921
}
2022
}

src/zedisdog/LaravelSchemaExtend/MySqlGrammar.php renamed to src/MySqlGrammar.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<?php namespace zedisdog\LaravelSchemaExtend;
1+
<?php
2+
namespace Jialeo\LaravelSchemaExtend;
23

34
use Illuminate\Support\Fluent;
45
use Illuminate\Database\Schema\Blueprint;

src/zedisdog/LaravelSchemaExtend/Schema.php renamed to src/Schema.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
namespace zedisdog\LaravelSchemaExtend;
2+
namespace Jialeo\LaravelSchemaExtend;
33

44
use \Illuminate\Support\Facades\Facade;
55

@@ -30,12 +30,12 @@ protected static function getFacadeAccessor()
3030

3131

3232
/**
33-
* 引导系统调用我们自定义的 Grammar
33+
* lead the system to load custom Grammar
3434
* @param $connection
3535
*/
3636
protected static function useCustomGrammar($connection)
3737
{
38-
# 仅针对 MySqlGrammar
38+
// just for MySqlGrammar
3939
if (get_class($connection) === 'Illuminate\Database\MySqlConnection') {
4040
$MySqlGrammar = $connection->withTablePrefix(new MySqlGrammar);
4141
$connection->setSchemaGrammar($MySqlGrammar);

0 commit comments

Comments
 (0)