Skip to content

Commit d836241

Browse files
authored
Merge pull request #46 from hokoo/fix-dbdelta
fix dbDelta
2 parents da2df3c + 2ebbb60 commit d836241

File tree

1 file changed

+33
-28
lines changed

1 file changed

+33
-28
lines changed

src/WPStorage.php

Lines changed: 33 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -51,34 +51,39 @@ private function init()
5151
$this->install();
5252
}
5353

54-
private function install()
55-
{
56-
Database::install_table($this->get_connections_table(), "
57-
`ID` bigint(20) unsigned NOT NULL auto_increment,
58-
`relation` varchar(255) NOT NULL,
59-
`from` bigint(20) unsigned NOT NULL,
60-
`to` bigint(20) unsigned NOT NULL,
61-
`order` bigint(20) unsigned NULL default '0',
62-
`title` varchar(63) NULL default '',
63-
64-
PRIMARY KEY (`ID`),
65-
INDEX `from` (`from`),
66-
INDEX `to` (`to`),
67-
INDEX `order` (`order`),
68-
INDEX `relation` (`relation`)
69-
");
70-
71-
Database::install_table($this->get_meta_table(), "
72-
`meta_id` bigint(20) unsigned NOT NULL auto_increment,
73-
`connection_id` bigint(20) unsigned NOT NULL default '0',
74-
`meta_key` varchar(255) NOT NULL,
75-
`meta_value` longtext NOT NULL,
76-
77-
PRIMARY KEY (`meta_id`),
78-
INDEX `connection_id` (`connection_id`),
79-
INDEX `key` (`meta_key`)
80-
");
81-
}
54+
private function install()
55+
{
56+
Database::install_table(
57+
$this->get_connections_table(),
58+
"
59+
`ID` bigint(20) unsigned NOT NULL auto_increment,
60+
`relation` varchar(255) NOT NULL,
61+
`from` bigint(20) unsigned NOT NULL,
62+
`to` bigint(20) unsigned NOT NULL,
63+
`order` bigint(20) unsigned NULL default '0',
64+
`title` varchar(63) NULL default '',
65+
PRIMARY KEY (`ID`),
66+
KEY `from` (`from`),
67+
KEY `to` (`to`),
68+
KEY `order` (`order`),
69+
KEY `relation` (`relation`)
70+
"
71+
);
72+
73+
Database::install_table(
74+
$this->get_meta_table(),
75+
"
76+
`meta_id` bigint(20) unsigned NOT NULL auto_increment,
77+
`connection_id` bigint(20) unsigned NOT NULL default '0',
78+
`meta_key` varchar(255) NOT NULL,
79+
`meta_value` longtext NOT NULL,
80+
PRIMARY KEY (`meta_id`),
81+
KEY `connection_id` (`connection_id`),
82+
KEY `meta_key` (`meta_key`)
83+
"
84+
);
85+
}
86+
8287

8388
/**
8489
* Deletes connections by set of connection IDs

0 commit comments

Comments
 (0)