Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Laravel Dacapo 2019-09-06 YYPHP 99

Laravel Dacapo 2019-09-06 YYPHP 99

Laravel Dacapo (ダカーポ) マイグレーション生成サポートツール 作りました!

ゆうきゃん

September 06, 2019
Tweet

More Decks by ゆうきゃん

Other Decks in Programming

Transcript

  1. ࡞੒ͷϚΠάϨʔγϣϯ $ php artisan make:migration create_articles_table Created Migration: 2019_09_06_031620_create_articles_table class

    CreateArticlesTable extends Migration { public function up() { Schema::create('articles', function (Blueprint $table) { $table->bigIncrements('id'); $table->mediumText('content'); $table->timestamps(); }); } public function down() { Schema::dropIfExists('articles'); } } php artisan migrate
  2. มߋͷϚΠάϨʔγϣϯ $ php artisan make:migration add_title_to_articles_table Created Migration: 2019_09_06_031659_add_title_to_articles_table class

    AddTitleToArticlesTable extends Migration { public function up() { Schema::table('articles', function (Blueprint $table) { $table->string('title')->after('id'); }); } public function down() { Schema::table('articles', function (Blueprint $table) { $table->dropColumn('string'); }); } } php artisan migrate
  3. articles: columns: id: bigIncrements title: string content: mediumText users: columns:

    id: bigIncrements name: string email: type: string unique: true email_verified_at: type: timestamp nullable: true password: string rememberToken: true timestamps: true schema.yml Λఆٛ $ php artisan dacapo:generate