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
190
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
990
モテるコードの書き方
ucan_lab
0
200
momochanにも分かるPSR講座
ucan_lab
0
36
ターミナルtips
ucan_lab
0
74
ゆうきゃんどっかー のススメ In #TechCafe
ucan_lab
2
230
Laravel + Docker 環境構築ハンズオン
ucan_lab
2
330
Laravel+GraphQL 良かったこと 困ったこと 悲しかったこと
ucan_lab
2
610
バージョン管理ツールについて振り返り
ucan_lab
0
61
Other Decks in Programming
See All in Programming
Elm 0.19.0 Changes
bkuhlmann
0
500
Three ways to use AI on Android: The Good, the Bad and the Ugly
marxallski
0
100
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
6
1.1k
Deep Dive into React Stream/Serialize
mugi_uno
3
560
Polars入門
daikikatsuragawa
1
160
Ruby Pattern Matching
bkuhlmann
0
930
MicrosoftのPlatform Engineeringガイドを読んで実際になにかやってみた
ymd65536
1
500
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
480
GraphQLサーバの構成要素を整理する #ハッカー鮨 #tsukijigraphql / graphql server technology selection
izumin5210
4
900
Fast JSX: Don't clone props object #28768
yossydev
1
160
if constexpr文はテンプレート世界のラムダ式である
faithandbrave
3
670
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
180
Featured
See All Featured
Design by the Numbers
sachag
274
18k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
GraphQLとの向き合い方2022年版
quramy
33
12k
Music & Morning Musume
bryan
41
5.6k
Facilitating Awesome Meetings
lara
43
5.6k
Teambox: Starting and Learning
jrom
128
8.4k
Building Your Own Lightsaber
phodgson
100
5.7k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
20
1.7k
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͍ͩ͘͞ɻ ʢ͓ئ͍͠·͢ԿͰ͠·͔͢Βʣ