first commit
This commit is contained in:
3
console/config/.gitignore
vendored
Executable file
3
console/config/.gitignore
vendored
Executable file
@ -0,0 +1,3 @@
|
||||
main-local.php
|
||||
params-local.php
|
||||
test-local.php
|
1
console/config/bootstrap.php
Executable file
1
console/config/bootstrap.php
Executable file
@ -0,0 +1 @@
|
||||
<?php
|
36
console/config/main.php
Executable file
36
console/config/main.php
Executable file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
$params = array_merge(
|
||||
require __DIR__ . '/../../common/config/params.php',
|
||||
require __DIR__ . '/../../common/config/params-local.php',
|
||||
require __DIR__ . '/params.php',
|
||||
require __DIR__ . '/params-local.php'
|
||||
);
|
||||
|
||||
return [
|
||||
'id' => 'app-console',
|
||||
'basePath' => dirname(__DIR__),
|
||||
'bootstrap' => ['log'],
|
||||
'controllerNamespace' => 'console\controllers',
|
||||
'aliases' => [
|
||||
'@bower' => '@vendor/bower-asset',
|
||||
'@npm' => '@vendor/npm-asset',
|
||||
],
|
||||
'controllerMap' => [
|
||||
'fixture' => [
|
||||
'class' => \yii\console\controllers\FixtureController::class,
|
||||
'namespace' => 'common\fixtures',
|
||||
],
|
||||
],
|
||||
'components' => [
|
||||
'log' => [
|
||||
'targets' => [
|
||||
[
|
||||
'class' => \yii\log\FileTarget::class,
|
||||
'levels' => ['error', 'warning'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'params' => $params,
|
||||
];
|
5
console/config/params.php
Executable file
5
console/config/params.php
Executable file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'adminEmail' => 'admin@example.com',
|
||||
];
|
4
console/config/test.php
Executable file
4
console/config/test.php
Executable file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
0
console/controllers/.gitkeep
Executable file
0
console/controllers/.gitkeep
Executable file
33
console/migrations/m130524_201442_init.php
Executable file
33
console/migrations/m130524_201442_init.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
class m130524_201442_init extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$tableOptions = null;
|
||||
if ($this->db->driverName === 'mysql') {
|
||||
// http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
|
||||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
|
||||
}
|
||||
|
||||
$this->createTable('{{%user}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'username' => $this->string()->notNull()->unique(),
|
||||
'auth_key' => $this->string(32)->notNull(),
|
||||
'password_hash' => $this->string()->notNull(),
|
||||
'password_reset_token' => $this->string()->unique(),
|
||||
'email' => $this->string()->notNull()->unique(),
|
||||
|
||||
'status' => $this->smallInteger()->notNull()->defaultValue(10),
|
||||
'created_at' => $this->integer()->notNull(),
|
||||
'updated_at' => $this->integer()->notNull(),
|
||||
], $tableOptions);
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropTable('{{%user}}');
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use \yii\db\Migration;
|
||||
|
||||
class m190124_110200_add_verification_token_column_to_user_table extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->addColumn('{{%user}}', 'verification_token', $this->string()->defaultValue(null));
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->dropColumn('{{%user}}', 'verification_token');
|
||||
}
|
||||
}
|
30
console/migrations/m230503_111312_create_news_table.php
Executable file
30
console/migrations/m230503_111312_create_news_table.php
Executable file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%news}}`.
|
||||
*/
|
||||
class m230503_111312_create_news_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%news}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'title' => $this->string(),
|
||||
'text' => $this->text(),
|
||||
'slug' => $this->string()->unique()
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropTable('{{%news}}');
|
||||
}
|
||||
}
|
33
console/migrations/m230503_151339_create_profile_table.php
Executable file
33
console/migrations/m230503_151339_create_profile_table.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%profile}}`.
|
||||
*/
|
||||
class m230503_151339_create_profile_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%profile}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'user_id' => $this->integer(),
|
||||
'created_at' => $this->timestamp(),
|
||||
'image' => $this->string(),
|
||||
'activity' => $this->tinyInteger()
|
||||
]);
|
||||
$this->addForeignKey('user_foreign', 'profile', 'user_id', 'user', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('user_foreign', 'profile');
|
||||
$this->dropTable('{{%profile}}');
|
||||
}
|
||||
}
|
33
console/migrations/m230503_151354_create_text_table.php
Executable file
33
console/migrations/m230503_151354_create_text_table.php
Executable file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use yii\db\Migration;
|
||||
|
||||
/**
|
||||
* Handles the creation of table `{{%text}}`.
|
||||
*/
|
||||
class m230503_151354_create_text_table extends Migration
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeUp()
|
||||
{
|
||||
$this->createTable('{{%text}}', [
|
||||
'id' => $this->primaryKey(),
|
||||
'profile_id' => $this->integer(),
|
||||
'title' => $this->string(),
|
||||
'text' => $this->text(),
|
||||
'language' => $this->string()
|
||||
]);
|
||||
$this->addForeignKey('profile_foreign', 'text', 'profile_id', 'profile', 'id');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function safeDown()
|
||||
{
|
||||
$this->dropForeignKey('profile_foreign', 'text');
|
||||
$this->dropTable('{{%text}}');
|
||||
}
|
||||
}
|
1
console/models/.gitkeep
Executable file
1
console/models/.gitkeep
Executable file
@ -0,0 +1 @@
|
||||
*
|
2
console/runtime/.gitignore
vendored
Executable file
2
console/runtime/.gitignore
vendored
Executable file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
Reference in New Issue
Block a user