Browse Source

Migration / modèles section développement

Création des tables et des modèles pour la section développement de l'administration. Cette section regroupe les développements en cours pour la plateforme et sont visibles aux producteurs. Ces derniers peuvent définir leur priorités.
prodstable
keun 7 years ago
parent
commit
39ae497244
3 changed files with 127 additions and 0 deletions
  1. +56
    -0
      common/models/Developpement.php
  2. +42
    -0
      common/models/DeveloppementPriorite.php
  3. +29
    -0
      console/migrations/m171226_200642_tables_developpement.php

+ 56
- 0
common/models/Developpement.php View File

@@ -0,0 +1,56 @@
<?php

namespace app\models;

use Yii;

/**
* This is the model class for table "developpement".
*
* @property integer $id
* @property string $objet
* @property string $description
* @property string $date
* @property integer $avancement
* @property string $statut
* @property double $estimation_temps
*/
class Developpement extends \yii\db\ActiveRecord {

/**
* @inheritdoc
*/
public static function tableName() {
return 'developpement';
}

/**
* @inheritdoc
*/
public function rules() {
return [
[['id', 'objet', 'date'], 'required'],
[['id', 'avancement'], 'integer'],
[['description'], 'string'],
[['date'], 'safe'],
[['estimation_temps'], 'number'],
[['objet', 'statut'], 'string', 'max' => 255],
];
}

/**
* @inheritdoc
*/
public function attributeLabels() {
return [
'id' => 'ID',
'objet' => 'Objet',
'description' => 'Description',
'date' => 'Date',
'avancement' => 'Avancement',
'statut' => 'Statut',
'estimation_temps' => 'Estimation temps',
];
}

}

+ 42
- 0
common/models/DeveloppementPriorite.php View File

@@ -0,0 +1,42 @@
<?php

namespace app\models;

use Yii;

/**
* This is the model class for table "developpement_priorite".
*
* @property integer $id_user
* @property integer $id_developpement
*/
class DeveloppementPriorite extends \yii\db\ActiveRecord {

/**
* @inheritdoc
*/
public static function tableName() {
return 'developpement_priorite';
}

/**
* @inheritdoc
*/
public function rules() {
return [
[['id_user', 'id_developpement'], 'required'],
[['id_user', 'id_developpement'], 'integer'],
];
}

/**
* @inheritdoc
*/
public function attributeLabels() {
return [
'id_user' => 'Id User',
'id_developpement' => 'Id Developpement',
];
}

}

+ 29
- 0
console/migrations/m171226_200642_tables_developpement.php View File

@@ -0,0 +1,29 @@
<?php

use yii\db\Migration;
use yii\db\Schema;

class m171226_200642_tables_developpement extends Migration {

public function up() {
$this->createTable('developpement', [
'id' => Schema::TYPE_INTEGER . ' NOT NULL',
'objet' => Schema::TYPE_STRING . ' NOT NULL',
'description' => Schema::TYPE_TEXT,
'date' => Schema::TYPE_DATE . ' NOT NULL',
'avancement' => Schema::TYPE_INTEGER . ' DEFAULT 0',
'statut' => Schema::TYPE_STRING . ' DEFAULT \'open\'',
'estimation_temps' => Schema::TYPE_FLOAT,
]);

$this->createTable('developpement_priorite', [
'id_user' => Schema::TYPE_INTEGER . ' NOT NULL',
'id_developpement' => Schema::TYPE_INTEGER . ' NOT NULL',
]);
}

public function down() {
$this->dropTable('developpement') ;
$this->dropTable('developpement_priorite') ;
}
}

Loading…
Cancel
Save