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
210
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.1k
モテるコードの書き方
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
410
Laravel+GraphQL 良かったこと 困ったこと 悲しかったこと
ucan_lab
2
680
バージョン管理ツールについて振り返り
ucan_lab
0
61
Other Decks in Programming
See All in Programming
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
220
【Kaigi on Rails 2024】YOUTRUST スポンサーLT
krpk1900
1
330
WebフロントエンドにおけるGraphQL(あるいはバックエンドのAPI)との向き合い方 / #241106_plk_frontend
izumin5210
4
1.4k
Remix on Hono on Cloudflare Workers
yusukebe
1
290
cmp.Or に感動した
otakakot
3
180
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
Arm移行タイムアタック
qnighy
0
330
macOS でできる リアルタイム動画像処理
biacco42
9
2.4k
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.2k
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
290
Jakarta EE meets AI
ivargrimstad
0
180
Make Impossible States Impossibleを 意識してReactのPropsを設計しよう
ikumatadokoro
0
170
Featured
See All Featured
We Have a Design System, Now What?
morganepeng
50
7.2k
Faster Mobile Websites
deanohume
305
30k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
44
2.2k
Imperfection Machines: The Place of Print at Facebook
scottboms
265
13k
Being A Developer After 40
akosma
86
590k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Become a Pro
speakerdeck
PRO
25
5k
Ruby is Unlike a Banana
tanoku
97
11k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
96
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
232
17k
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͍ͩ͘͞ɻ ʢ͓ئ͍͠·͢ԿͰ͠·͔͢Βʣ