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
220
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
36
ターミナルtips
ucan_lab
0
84
ゆうきゃんどっかー のススメ In #TechCafe
ucan_lab
2
240
Laravel + Docker 環境構築ハンズオン
ucan_lab
2
420
Laravel+GraphQL 良かったこと 困ったこと 悲しかったこと
ucan_lab
2
690
バージョン管理ツールについて振り返り
ucan_lab
0
63
Other Decks in Programming
See All in Programming
Spatial Rendering for Apple Vision Pro
warrenm
0
110
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
340
CSC305 Lecture 26
javiergs
PRO
0
140
Haze - Real time background blurring
chrisbanes
1
510
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
MCP with Cloudflare Workers
yusukebe
2
220
useSyncExternalStoreを使いまくる
ssssota
6
1.1k
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
Асинхронность неизбежна: как мы проектировали сервис уведомлений
lamodatech
0
820
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
How to Ace a Technical Interview
jacobian
276
23k
Bash Introduction
62gerente
608
210k
Designing Experiences People Love
moore
138
23k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Site-Speed That Sticks
csswizardry
2
190
Large-scale JavaScript Application Architecture
addyosmani
510
110k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
8
1.2k
BBQ
matthewcrist
85
9.4k
Practical Orchestrator
shlominoach
186
10k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Unsuck your backbone
ammeep
669
57k
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͍ͩ͘͞ɻ ʢ͓ئ͍͠·͢ԿͰ͠·͔͢Βʣ