Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Laravel Dacapo 2019-09-06 YYPHP 99
Search
ゆうきゃん
September 06, 2019
Programming
0
230
Laravel Dacapo 2019-09-06 YYPHP 99
Laravel Dacapo (ダカーポ) マイグレーション生成サポートツール 作りました!
ゆうきゃん
September 06, 2019
Tweet
Share
More Decks by ゆうきゃん
See All by ゆうきゃん
開発体験を爆上げするLaravel Dacapo マイグレーションサポートツールのススメ
ucan_lab
0
1.2k
モテるコードの書き方
ucan_lab
0
230
momochanにも分かるPSR講座
ucan_lab
0
39
ターミナルtips
ucan_lab
0
86
ゆうきゃんどっかー のススメ In #TechCafe
ucan_lab
2
240
Laravel + Docker 環境構築ハンズオン
ucan_lab
2
440
Laravel+GraphQL 良かったこと 困ったこと 悲しかったこと
ucan_lab
2
710
バージョン管理ツールについて振り返り
ucan_lab
0
65
Other Decks in Programming
See All in Programming
CI改善もDatadogとともに
taumu
0
120
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
5.3k
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
110
クリーンアーキテクチャから見る依存の向きの大切さ
shimabox
2
400
Flutter × Firebase Genkit で加速する生成 AI アプリ開発
coborinai
0
160
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
310
sappoRo.R #12 初心者セッション
kosugitti
0
250
Open source software: how to live long and go far
gaelvaroquaux
0
640
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
150
第3回 Snowflake 中部ユーザ会- dbt × Snowflake ハンズオン
hoto17296
4
370
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
120
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
223
9.3k
GraphQLとの向き合い方2022年版
quramy
44
13k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
133
33k
How to train your dragon (web standard)
notwaldorf
91
5.8k
Why You Should Never Use an ORM
jnunemaker
PRO
55
9.2k
YesSQL, Process and Tooling at Scale
rocio
172
14k
How to Ace a Technical Interview
jacobian
276
23k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
Automating Front-end Workflow
addyosmani
1368
200k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
Transcript
Laravel Dacapo(μΧʔϙ) ϚΠάϨʔγϣϯੜαϙʔτπʔϧ ࡞Γ·ͨ͠ʂ 2019.09.06 YYPHP#99 @ucan_lab
ࣗݾհ ࢲ͕Ώ͏͖ΌΜͰ͢ɻ
LaravelͷϚΠάϨʔγϣϯ ॻ͘ͷɺ μϧ͘ͳ͍Ͱ͔͢ʁ
جຊͷϚΠάϨʔγϣϯ 1. ϚΠάϨʔγϣϯͻͳܗੜίϚϯυ 2. ϚΠάϨʔγϣϯͷup ͱ down Λॻ͘ 3. ϚΠάϨʔγϣϯ࣮ߦίϚϯυ
࡞ͷϚΠάϨʔγϣϯ $ 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
มߋͷϚΠάϨʔγϣϯ $ 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
͜ΕΛ܁Γฦ͠·͢
None
μϧ͍ϙΠϯτ
μϧ͍ϙΠϯτ • ࠷৽ͷςʔϒϧߏ͕͔Βͳ͍ • ςʔϒϧมߋͷίετ͕େ͖͍ • Ϋϥε໊ϢχʔΫʹ͢Δඞཁ͕͋Δ • up, down
ͷ߹ੑΛؾʹ͢Δ • ࡧҾ֎෦Ωʔ͕ೖΔͱ͞Βʹ͘͜͠...
ͱʹ͔͘ΊΜͲ͍͘͞
୭͔͕ݴ͍·ͨ͠ɻ
ਓ͕ؒΔ͖Ͱͳ͍͜ͱ ϓϩάϥϜʹπʔϧʹͤΑ͏ @nrslib ͞Μͷ͓ݴ༿ΑΓ
͜ͷΛղܾ͢Δͷ͕ μΧʔϙͰ͢ʂ
ucan-lab/laravel-dacapo
μΧʔϙͷΠϯετʔϧ $ composer require --dev ucan-lab/laravel-dacapo
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
None
μΧʔϙͷػೳᶃ • طଘͷϚΠάϨʔγϣϯΛআ͠ɺ schema.yml ͷهड़Λݩʹ࠷৽ͷঢ়ଶͷϚΠάϨʔ γϣϯϑΝΠϧΛੜ͠·͢ɻ • php artisan migrate:fresh
Ͱશςʔϒϧͷআ͠ɺ ϚΠάϨʔγϣϯΛ࣮ߦ͢Δӡ༻Ͱ͢ɻ
μΧʔϙͷػೳᶄ • ςʔϒϧ࡞ͷϚΠάϨʔγϣϯϑΝΠϧΛੜ • ֎෦Ωʔ੍ͷϚΠάϨʔγϣϯϑΝΠϧΛੜ • Ұҙ੍ɺࡧҾͷϚΠάϨʔγϣϯϑΝΠϧΛੜ • Eloquent ModelͷͻͳܗΛੜ
μΧʔϙͷҙɾཹҙࣄ߲ • ಛੑ্ɺϓϩδΣΫτͷॳظϑΣʔζʹ༻͢Δϥ ΠϒϥϦͰ͢ɻ • ӡ༻ϑΣʔζʹೖͬͨΒμΧʔϙΞϯΠϯετʔ ϧ͠ɺ௨ৗͷϚΠάϨʔγϣϯӡ༻ʹ͠·͢ɻ • ຊ൪ͷσʔλ͕શ෦ফ͑ͯ͠·͏ͷͰ...ɻɻ
μΧʔϙͷಋೖͨ͠ϝϦοτ • ৗʹ࠷৽ͷςʔϒϧߏͰݟ͍͢ • ςʔϒϧɺ֎෦ɺࡧҾͱ͔Εͯͯݟ͍͢ • schema.yml ҰݩཧͷͨΊݟ͍͢ • yml
άϧʔϓ͝ͱʹׂͰ͖͔ͯΓ͍͢
μΧʔϙͷࠓޙ ver3.0
ͱ͜ΖͰ
2019.09.03 Laravel 6 Released
͓ΊͰͱ͏͍͟͝·͢
ͪΖΜ
μΧʔϙ Laravel 6.0 αϙʔτࡁΈ
͍͞͝ʹ • ػձ͕͋ͬͨΒͥͻͬͯΈ͍ͯͩ͘͞ʂ • GitHubʹstar͍ͩ͘͞ɻ ʢ͓ئ͍͠·͢ԿͰ͠·͔͢Βʣ