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
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
770
create_tableをしただけなのに〜囚われのuuid編〜
daisukeshinoku
0
260
php-conference-japan-2024
tasuku43
0
300
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
250
DevFest Tokyo 2025 - Flutter のアプリアーキテクチャ現在地点
wasabeef
5
910
Spatial Rendering for Apple Vision Pro
warrenm
0
110
Symfony Mapper Component
soyuka
2
730
42 best practices for Symfony, a decade later
tucksaun
1
180
Keeping it Ruby: Why Your Product Needs a Ruby SDK - RubyWorld 2024
envek
0
190
[JAWS-UG横浜 #76] イケてるアップデートを宇宙いち早く紹介するよ!
maroon1st
0
460
暇に任せてProxmoxコンソール 作ってみました
karugamo
2
720
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
How GitHub (no longer) Works
holman
311
140k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Being A Developer After 40
akosma
87
590k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Adopting Sorbet at Scale
ufuk
73
9.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
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͍ͩ͘͞ɻ ʢ͓ئ͍͠·͢ԿͰ͠·͔͢Βʣ