You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$connection->statement("CREATE TABLE IF NOT EXISTS `" . static::getSchemaTable('group_user')->name . "` (
206
-
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
207
-
`user_id` int(10) unsigned NOT NULL,
208
-
`group_id` int(10) unsigned NOT NULL,
209
-
PRIMARY KEY (`id`)
210
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Maps users to their group(s)' AUTO_INCREMENT=1 ;");
211
-
212
-
$connection->statement("CREATE TABLE IF NOT EXISTS `" . static::getSchemaTable('user')->name . "` (
213
-
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
214
-
`user_name` varchar(50) NOT NULL,
215
-
`display_name` varchar(50) NOT NULL,
216
-
`email` varchar(150) NOT NULL,
217
-
`title` varchar(150) NOT NULL,
218
-
`locale` varchar(10) NOT NULL DEFAULT 'en_US' COMMENT 'The language and locale to use for this user.',
219
-
`primary_group_id` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'The id of this user''s primary group.',
220
-
`secret_token` varchar(32) NOT NULL DEFAULT '' COMMENT 'The current one-time use token for various user activities confirmed via email.',
221
-
`flag_verified` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Set to ''1'' if the user has verified their account via email, ''0'' otherwise.',
222
-
`flag_enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Set to ''1'' if the user''s account is currently enabled, ''0'' otherwise. Disabled accounts cannot be logged in to, but they retain all of their data and settings.',
223
-
`flag_password_reset` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Set to ''1'' if the user has an outstanding password reset request, ''0'' otherwise.',
if (!$schema->hasTable(static::getSchemaTable('configuration')->name)) {
172
+
$schema->create(static::getSchemaTable('configuration')->name, function (Blueprint$table) {
173
+
$table->increments('id');
174
+
$table->string('plugin', 50)->comment("The name of the plugin that manages this setting (set to ''userfrosting'' for core settings)");
175
+
$table->string('name', 150)->comment('The name of the setting.');
176
+
$table->text('value')->comment('The current value of the setting.');
177
+
$table->text('description')->comment('A brief description of this setting.');
178
+
$table->engine = 'InnoDB';
179
+
$table->collation = 'utf8_unicode_ci';
180
+
$table->charset = 'utf8';
181
+
});
182
+
}
183
+
184
+
/**
185
+
* `authorize_group` table.
186
+
*/
187
+
if (!$schema->hasTable(static::getSchemaTable('authorize_group')->name)) {
188
+
$schema->create(static::getSchemaTable('authorize_group')->name, function (Blueprint$table) {
189
+
$table->increments('id');
190
+
$table->integer('group_id')->unsigned();
191
+
$table->string('hook', 200)->comment('A code that references a specific action or URI that the group has access to.');
192
+
$table->text('conditions')->comment('The conditions under which members of this group have access for this hook.');
193
+
$table->engine = 'InnoDB';
194
+
$table->collation = 'utf8_unicode_ci';
195
+
$table->charset = 'utf8';
196
+
});
197
+
}
238
198
239
-
$connection->statement("CREATE TABLE IF NOT EXISTS `" . static::$app->remember_me_table['tableName'] . "` (
240
-
`user_id` int(11) NOT NULL,
241
-
`token` varchar(40) NOT NULL,
242
-
`persistent_token` varchar(40) NOT NULL,
243
-
`expires` datetime NOT NULL
244
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;");
199
+
/**
200
+
* `authorize_user` table.
201
+
*/
202
+
if (!$schema->hasTable(static::getSchemaTable('authorize_user')->name)) {
203
+
$schema->create(static::getSchemaTable('authorize_user')->name, function (Blueprint$table) {
204
+
$table->increments('id');
205
+
$table->integer('user_id')->unsigned();
206
+
$table->string('hook', 200)->comment('A code that references a specific action or URI that the user has access to.');
207
+
$table->text('conditions')->comment('The conditions under which the user has access for this hook.');
208
+
$table->engine = 'InnoDB';
209
+
$table->collation = 'utf8_unicode_ci';
210
+
$table->charset = 'utf8';
211
+
});
212
+
}
213
+
214
+
/**
215
+
* `group` table.
216
+
*/
217
+
if (!$schema->hasTable(static::getSchemaTable('group')->name)) {
218
+
$schema->create(static::getSchemaTable('group')->name, function (Blueprint$table) {
219
+
$table->increments('id');
220
+
$table->string('name', 150);
221
+
$table->boolean('is_default')->default(0)->comment('Specifies whether this permission is a default setting for new accounts.');
222
+
$table->boolean('can_delete')->default(1)->comment('Specifies whether this permission can be deleted from the control panel.');
223
+
$table->string('theme', 100)->default('default')->comment('The theme assigned to primary users in this group.');
224
+
$table->string('landing_page', 200)->default('dashboard')->comment('The page to take primary members to when they first log in.');
225
+
$table->string('new_user_title', 200)->default('New User')->comment('The default title to assign to new primary users.');
226
+
$table->string('icon', 100)->default('fa fa-user')->comment('The icon representing primary users in this group.');
227
+
$table->engine = 'InnoDB';
228
+
$table->collation = 'utf8_unicode_ci';
229
+
$table->charset = 'utf8';
230
+
});
231
+
}
232
+
233
+
/**
234
+
* `group_user` table.
235
+
*/
236
+
if (!$schema->hasTable(static::getSchemaTable('group_user')->name)) {
237
+
$schema->create(static::getSchemaTable('group_user')->name, function (Blueprint$table) {
238
+
$table->increments('id');
239
+
$table->integer('user_id')->unsigned();
240
+
$table->integer('group_id')->unsigned();
241
+
$table->engine = 'InnoDB';
242
+
$table->collation = 'utf8_unicode_ci';
243
+
$table->charset = 'utf8';
244
+
});
245
+
}
246
+
247
+
/**
248
+
* `user` table.
249
+
*/
250
+
if (!$schema->hasTable(static::getSchemaTable('user')->name)) {
251
+
$schema->create(static::getSchemaTable('user')->name, function (Blueprint$table) {
252
+
$table->increments('id');
253
+
$table->string('user_name', 50);
254
+
$table->string('display_name', 50);
255
+
$table->string('email', 150);
256
+
$table->string('title', 150);
257
+
$table->string('locale', 10)->default('en_US')->comment('The language and locale to use for this user.');
258
+
$table->integer('primary_group_id')->unsigned()->default(1)->comment("The id of this user''s primary group.");
259
+
$table->string('secret_token', 32)->default('')->comment('The current one-time use token for various user activities confirmed via email.');
260
+
$table->boolean('flag_verified')->default(1)->comment("Set to ''1'' if the user has verified their account via email, ''0'' otherwise.");
261
+
$table->boolean('flag_enabled')->default(1)->comment("Set to ''1'' if the user''s account is currently enabled, ''0'' otherwise. Disabled accounts cannot be logged in to, but they retain all of their data and settings.");
262
+
$table->boolean('flag_password_reset')->default(0)->comment("Set to ''1'' if the user has an outstanding password reset request, ''0'' otherwise.");
263
+
$table->timestamps();
264
+
$table->string('password', 255);
265
+
$table->engine = 'InnoDB';
266
+
$table->collation = 'utf8_unicode_ci';
267
+
$table->charset = 'utf8';
268
+
});
269
+
}
270
+
271
+
/**
272
+
* `user_event` table.
273
+
*/
274
+
if (!$schema->hasTable(static::getSchemaTable('user_event')->name)) {
275
+
$schema->create(static::getSchemaTable('user_event')->name, function (Blueprint$table) {
276
+
$table->increments('id');
277
+
$table->integer('user_id')->unsigned();
278
+
$table->string('event_type', 255)->comment('An identifier used to track the type of event.');
279
+
$table->timestamp('occurred_at');
280
+
$table->text('description');
281
+
$table->engine = 'InnoDB';
282
+
$table->collation = 'utf8_unicode_ci';
283
+
$table->charset = 'utf8';
284
+
});
285
+
}
286
+
287
+
/**
288
+
* 'remember me' table.
289
+
*/
290
+
if (!$schema->hasTable(static::$app->remember_me_table['tableName'])) {
291
+
$schema->create(static::$app->remember_me_table['tableName'], function (Blueprint$table) {
0 commit comments