1: | <?php |
2: | |
3: | use Illuminate\Database\Migrations\Migration; |
4: | use Illuminate\Database\Schema\Blueprint; |
5: | use Illuminate\Database\Capsule\Manager as Capsule; |
6: | |
7: | class CreateTable extends Migration |
8: | { |
9: | |
10: | |
11: | |
12: | |
13: | |
14: | public function up() |
15: | { |
16: | $sPrefix = Capsule::connection()->getTablePrefix(); |
17: | |
18: | $sSql = str_replace( |
19: | "%PREFIX%", |
20: | $sPrefix, |
21: | "CREATE TABLE IF NOT EXISTS `%PREFIX%adav_sharedfiles` ( |
22: | `id` int(11) NOT NULL AUTO_INCREMENT, |
23: | `storage` varchar(255) DEFAULT NULL, |
24: | `path` varchar(255) DEFAULT NULL, |
25: | `uid` varchar(255) DEFAULT NULL, |
26: | `owner` varchar(255) DEFAULT NULL, |
27: | `principaluri` varchar(255) DEFAULT NULL, |
28: | `access` int(11) DEFAULT NULL, |
29: | `isdir` tinyint(1) DEFAULT '0', |
30: | PRIMARY KEY (`id`) |
31: | ) |
32: | ENGINE=InnoDB |
33: | DEFAULT CHARSET=utf8 |
34: | COLLATE='utf8_general_ci';" |
35: | ); |
36: | Capsule::connection()->statement($sSql); |
37: | } |
38: | |
39: | |
40: | |
41: | |
42: | |
43: | |
44: | public function down() |
45: | { |
46: | Capsule::schema()->dropIfExists('adav_sharedfiles'); |
47: | } |
48: | } |
49: | |