openrat-cms

# OpenRat Content Management System
git clone http://git.code.weiherhei.de/openrat-cms.git
Log | Files | Refs

DBVersion000021.class.php (1290B)


      1 <?php
      2 
      3 use database\DbVersion;
      4 
      5 /**
      6  * Authentication tokens.
      7  *
      8  * @author dankert
      9  *
     10  */
     11 class DBVersion000021 extends DbVersion
     12 {
     13     /**
     14      *
     15      */
     16     public function update()
     17     {
     18         $this->addTable('auth');
     19 
     20         $this->addColumn('auth','selector'     ,OR_DB_COLUMN_TYPE_VARCHAR ,150 ,null,OR_DB_COLUMN_NOT_NULLABLE);
     21         $this->addColumn('auth','userid'       ,OR_DB_COLUMN_TYPE_INT  ,0   ,null,OR_DB_COLUMN_NOT_NULLABLE);
     22         $this->addColumn('auth','token'        ,OR_DB_COLUMN_TYPE_VARCHAR ,150 ,null,OR_DB_COLUMN_NOT_NULLABLE);
     23         $this->addColumn('auth','token_algo'   ,OR_DB_COLUMN_TYPE_INT  ,0   ,0   ,OR_DB_COLUMN_NOT_NULLABLE);
     24         $this->addColumn('auth','expires'      ,OR_DB_COLUMN_TYPE_INT  ,0   ,null,OR_DB_COLUMN_NOT_NULLABLE);
     25         $this->addColumn('auth','create_date'  ,OR_DB_COLUMN_TYPE_INT  ,0   ,null,OR_DB_COLUMN_NOT_NULLABLE);
     26         $this->addColumn('auth','platform'     ,OR_DB_COLUMN_TYPE_VARCHAR,255 ,null,OR_DB_COLUMN_NOT_NULLABLE);
     27         $this->addColumn('auth','name'         ,OR_DB_COLUMN_TYPE_VARCHAR,255 ,null,OR_DB_COLUMN_NOT_NULLABLE);
     28 
     29 
     30         $this->addPrimaryKey ('auth','id');
     31 
     32         $this->addConstraint ('auth','userid'     ,'user'  ,'id');
     33 
     34         $this->addUniqueIndex('auth','selector' );
     35     }
     36 }
     37