tmp commit

This commit is contained in:
iIronside
2022-11-10 16:00:43 +03:00
parent 45b110ac44
commit 1175b9f973
25 changed files with 4032 additions and 95 deletions

View File

@ -15,7 +15,10 @@ class m221108_135514_create_document_template_table extends Migration
$this->createTable('{{%document_template}}', [
'id' => $this->primaryKey(),
'title' => $this->string(),
'template_body' => $this->text()
'template_body' => $this->text(),
'status' => $this->integer(),
'created_at' => $this->dateTime(),
'updated_at' => $this->dateTime(),
]);
}

View File

@ -15,15 +15,21 @@ class m221108_135939_create_document_table extends Migration
$this->createTable('{{%document}}', [
'id' => $this->primaryKey(),
'company_id' => $this->integer(11)->notNull(),
'contractor_company_id' => $this->integer(11),
'contractor_company_id' => $this->integer(11)->notNull(),
'manager_id' => $this->integer(11)->notNull(),
'contractor_manager_id' => $this->integer(11)->notNull(),
'template_id' => $this->integer(11)->notNull(),
'title' => $this->string(),
'body' => $this->text(),
'created_at' => $this->dateTime(),
'updated_at' => $this->dateTime(),
]);
$this->addForeignKey('company_document', 'document', 'company_id', 'company', 'id');
$this->addForeignKey('contractor_company_document', 'document', 'contractor_company_id', 'company', 'id');
$this->addForeignKey('manager_document', 'document', 'manager_id','manager', 'id');
$this->addForeignKey('contractor_manager_document', 'document', 'contractor_manager_id','manager', 'id');
$this->addForeignKey('document_template_document', 'document', 'template_id','document_template', 'id');
}
/**