CreateCmReferenceTable.php
3 weeks ago
CreateCollaborationsConnectedTable.php
3 weeks ago
CreateCollaborationsSentTable.php
3 weeks ago
CreateCollaborationsTable.php
3 weeks ago
CreateCommentsSeenTable.php
3 weeks ago
CreateCommentsTable.php
3 weeks ago
CreateFormsDataTable.php
3 weeks ago
CreateFormsTable.php
3 weeks ago
CreateCmReferenceTable.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Kirki\Database\Migrations; |
| 4 | |
| 5 | use Kirki\Framework\Contracts\Migration; |
| 6 | use Kirki\Framework\Database\Schema\Structure; |
| 7 | use Kirki\Framework\Supports\Facades\Schema; |
| 8 | |
| 9 | class CreateCmReferenceTable implements Migration |
| 10 | { |
| 11 | public function up() |
| 12 | { |
| 13 | Schema::create('kirki_cm_reference', function (Structure $table) { |
| 14 | $table->id(); |
| 15 | $table->unsigned_big_integer('post_id'); |
| 16 | $table->string('field_meta_key'); |
| 17 | $table->unsigned_big_integer('ref_post_id'); |
| 18 | $table->index('post_id'); |
| 19 | $table->index('ref_post_id'); |
| 20 | $table->foreign('post_id')->references('ID')->on('posts')->cascade_on_delete(); |
| 21 | $table->foreign('ref_post_id')->references('ID')->on('posts')->cascade_on_delete(); |
| 22 | }); |
| 23 | } |
| 24 | |
| 25 | public function down() |
| 26 | { |
| 27 | Schema::drop_if_exists('kirki_cm_reference'); |
| 28 | } |
| 29 | } |
| 30 |