-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmigrate.php
More file actions
38 lines (33 loc) · 1.17 KB
/
migrate.php
File metadata and controls
38 lines (33 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require_once __DIR__ . '/bootstrap.php';
use Illuminate\Database\Capsule\Manager as Capsule;
if (!Capsule::schema()->hasTable('todos')) {
Capsule::schema()->create('todos', function ($table) {
$table->increments('id');
$table->string('title');
$table->boolean('completed')->default(false);
$table->timestamps();
});
echo "Table 'todos' created successfully.\n";
}
if (!Capsule::schema()->hasTable('seo')) {
Capsule::schema()->create('seo', function ($table) {
$table->increments('id');
$table->string('path')->unique();
$table->string('title')->nullable();
$table->text('description')->nullable();
$table->string('keywords')->nullable();
$table->string('og_image')->nullable();
$table->timestamps();
});
echo "Table 'seo' created successfully.\n";
}
if (!Capsule::schema()->hasTable('settings')) {
Capsule::schema()->create('settings', function ($table) {
$table->increments('id');
$table->string('key')->unique();
$table->text('value')->nullable();
$table->timestamps();
});
echo "Table 'settings' created successfully.\n";
}