Skip to content

Commit 820dc8c

Browse files
committed
Fill model faker as per dependencies order
1 parent 16b0a7a commit 820dc8c

39 files changed

+7045
-5
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,3 +205,9 @@ Professional support, consulting as well as software development services are av
205205
https://www.cebe.cc/en/contact
206206

207207
Development of this library is sponsored by [cebe.:cloud: "Your Professional Deployment Platform"](https://cebe.cloud).
208+
209+
TODO
210+
211+
```bash
212+
./yii gii/api --openApiPath=/app/openapi/schema.yaml --generateMigrations=0 --generateControllers=0 --generateUrls=0
213+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/**
4+
* Table for C123
5+
*/
6+
class m230320_130000_create_table_c123s extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%c123s}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->text()->null()->defaultValue(null),
13+
]);
14+
}
15+
16+
public function down()
17+
{
18+
$this->dropTable('{{%c123s}}');
19+
}
20+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* Table for B123
5+
*/
6+
class m230320_130001_create_table_b123s extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%b123s}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->text()->null()->defaultValue(null),
13+
'c123_id' => $this->integer()->null()->defaultValue(null),
14+
]);
15+
$this->addForeignKey('fk_b123s_c123_id_c123s_id', '{{%b123s}}', 'c123_id', '{{%c123s}}', 'id');
16+
}
17+
18+
public function down()
19+
{
20+
$this->dropForeignKey('fk_b123s_c123_id_c123s_id', '{{%b123s}}');
21+
$this->dropTable('{{%b123s}}');
22+
}
23+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* Table for A123
5+
*/
6+
class m230320_130002_create_table_a123s extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%a123s}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->text()->null()->defaultValue(null),
13+
'b123_id' => $this->integer()->null()->defaultValue(null),
14+
]);
15+
$this->addForeignKey('fk_a123s_b123_id_b123s_id', '{{%a123s}}', 'b123_id', '{{%b123s}}', 'id');
16+
}
17+
18+
public function down()
19+
{
20+
$this->dropForeignKey('fk_a123s_b123_id_b123s_id', '{{%a123s}}');
21+
$this->dropTable('{{%a123s}}');
22+
}
23+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/**
4+
* Table for Account
5+
*/
6+
class m230320_130003_create_table_accounts extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%accounts}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->string(40)->notNull(),
13+
]);
14+
}
15+
16+
public function down()
17+
{
18+
$this->dropTable('{{%accounts}}');
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?php
2+
3+
/**
4+
* Table for D123
5+
*/
6+
class m230320_130004_create_table_d123s extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%d123s}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->text()->null()->defaultValue(null),
13+
]);
14+
}
15+
16+
public function down()
17+
{
18+
$this->dropTable('{{%d123s}}');
19+
}
20+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
/**
4+
* Table for Domain
5+
*/
6+
class m230320_130005_create_table_domains extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%domains}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->string(128)->notNull(),
13+
'account_id' => $this->integer()->notNull(),
14+
0 => 'created_at datetime NOT NULL',
15+
]);
16+
$this->addForeignKey('fk_domains_account_id_accounts_id', '{{%domains}}', 'account_id', '{{%accounts}}', 'id');
17+
}
18+
19+
public function down()
20+
{
21+
$this->dropForeignKey('fk_domains_account_id_accounts_id', '{{%domains}}');
22+
$this->dropTable('{{%domains}}');
23+
}
24+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
/**
4+
* Table for E123
5+
*/
6+
class m230320_130006_create_table_e123s extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%e123s}}', [
11+
'id' => $this->primaryKey(),
12+
'name' => $this->text()->null()->defaultValue(null),
13+
'b123_id' => $this->integer()->null()->defaultValue(null),
14+
]);
15+
$this->addForeignKey('fk_e123s_b123_id_b123s_id', '{{%e123s}}', 'b123_id', '{{%b123s}}', 'id');
16+
}
17+
18+
public function down()
19+
{
20+
$this->dropForeignKey('fk_e123s_b123_id_b123s_id', '{{%e123s}}');
21+
$this->dropTable('{{%e123s}}');
22+
}
23+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php
2+
3+
/**
4+
* Table for Routing
5+
*/
6+
class m230320_130007_create_table_routings extends \yii\db\Migration
7+
{
8+
public function up()
9+
{
10+
$this->createTable('{{%routings}}', [
11+
'id' => $this->primaryKey(),
12+
'domain_id' => $this->integer()->notNull(),
13+
'path' => $this->string(255)->null()->defaultValue(null),
14+
'ssl' => $this->boolean()->null()->defaultValue(null),
15+
'redirect_to_ssl' => $this->boolean()->null()->defaultValue(null),
16+
'service' => $this->string(255)->null()->defaultValue(null),
17+
0 => 'created_at datetime NULL DEFAULT NULL',
18+
'd123_id' => $this->integer()->null()->defaultValue(null),
19+
'a123_id' => $this->integer()->null()->defaultValue(null),
20+
]);
21+
$this->addForeignKey('fk_routings_domain_id_domains_id', '{{%routings}}', 'domain_id', '{{%domains}}', 'id');
22+
$this->addForeignKey('fk_routings_d123_id_d123s_id', '{{%routings}}', 'd123_id', '{{%d123s}}', 'id');
23+
$this->addForeignKey('fk_routings_a123_id_a123s_id', '{{%routings}}', 'a123_id', '{{%a123s}}', 'id');
24+
}
25+
26+
public function down()
27+
{
28+
$this->dropForeignKey('fk_routings_a123_id_a123s_id', '{{%routings}}');
29+
$this->dropForeignKey('fk_routings_d123_id_d123s_id', '{{%routings}}');
30+
$this->dropForeignKey('fk_routings_domain_id_domains_id', '{{%routings}}');
31+
$this->dropTable('{{%routings}}');
32+
}
33+
}

common/models/A123.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class A123 extends \common\models\base\A123
6+
{
7+
8+
9+
}
10+

common/models/Account.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class Account extends \common\models\base\Account
6+
{
7+
8+
9+
}
10+

common/models/B123.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class B123 extends \common\models\base\B123
6+
{
7+
8+
9+
}
10+

common/models/C123.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class C123 extends \common\models\base\C123
6+
{
7+
8+
9+
}
10+

common/models/D123.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class D123 extends \common\models\base\D123
6+
{
7+
8+
9+
}
10+

common/models/Domain.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class Domain extends \common\models\base\Domain
6+
{
7+
8+
9+
}
10+

common/models/E123.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class E123 extends \common\models\base\E123
6+
{
7+
8+
9+
}
10+

common/models/Routing.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace common\models;
4+
5+
class Routing extends \common\models\base\Routing
6+
{
7+
8+
9+
}
10+

common/models/base/A123.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace common\models\base;
4+
5+
/**
6+
* desc
7+
*
8+
* @property int $id
9+
* @property string $name
10+
* @property int $b123_id desc
11+
*
12+
* @property \common\models\B123 $b123
13+
*/
14+
abstract class A123 extends \yii\db\ActiveRecord
15+
{
16+
public static function tableName()
17+
{
18+
return '{{%a123s}}';
19+
}
20+
21+
public function rules()
22+
{
23+
return [
24+
'trim' => [['name'], 'trim'],
25+
'b123_id_integer' => [['b123_id'], 'integer'],
26+
'b123_id_exist' => [['b123_id'], 'exist', 'targetRelation' => 'B123'],
27+
'name_string' => [['name'], 'string'],
28+
];
29+
}
30+
31+
public function getB123()
32+
{
33+
return $this->hasOne(\common\models\B123::class, ['id' => 'b123_id']);
34+
}
35+
}

common/models/base/Account.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
namespace common\models\base;
4+
5+
/**
6+
* user account
7+
*
8+
* @property int $id
9+
* @property string $name account name
10+
*
11+
*/
12+
abstract class Account extends \yii\db\ActiveRecord
13+
{
14+
public static function tableName()
15+
{
16+
return '{{%accounts}}';
17+
}
18+
19+
public function rules()
20+
{
21+
return [
22+
'trim' => [['name'], 'trim'],
23+
'required' => [['name'], 'required'],
24+
'name_string' => [['name'], 'string', 'max' => 40],
25+
];
26+
}
27+
}

common/models/base/B123.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace common\models\base;
4+
5+
/**
6+
* desc
7+
*
8+
* @property int $id
9+
* @property string $name
10+
* @property int $c123_id desc
11+
*
12+
* @property \common\models\C123 $c123
13+
*/
14+
abstract class B123 extends \yii\db\ActiveRecord
15+
{
16+
public static function tableName()
17+
{
18+
return '{{%b123s}}';
19+
}
20+
21+
public function rules()
22+
{
23+
return [
24+
'trim' => [['name'], 'trim'],
25+
'c123_id_integer' => [['c123_id'], 'integer'],
26+
'c123_id_exist' => [['c123_id'], 'exist', 'targetRelation' => 'C123'],
27+
'name_string' => [['name'], 'string'],
28+
];
29+
}
30+
31+
public function getC123()
32+
{
33+
return $this->hasOne(\common\models\C123::class, ['id' => 'c123_id']);
34+
}
35+
}

0 commit comments

Comments
 (0)