"Fossies" - the Fresh Open Source Software Archive

Member "4.6.1/db/migrations/07_table_token_class.php" (8 Apr 2021, 1150 Bytes) of package /linux/www/studip-4.6.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 <?
    2 class TableTokenClass extends Migration
    3 {
    4     public function description ()
    5     {
    6         return 'creates table for Token class';
    7     }
    8 
    9     public function up ()
   10     {
   11         $this->announce(" creating table...");
   12         
   13         DBManager::get()->exec("CREATE TABLE IF NOT EXISTS `user_token` (
   14                                         `user_id` VARCHAR( 32 ) NOT NULL ,
   15                                         `token` VARCHAR( 32 ) NOT NULL ,
   16                                         `expiration` INT NOT NULL ,
   17                                         PRIMARY KEY ( `user_id` , `token` , `expiration` ),
   18                                         INDEX index_expiration (`expiration`),
   19                                         INDEX index_token (`token`),
   20                                         INDEX index_user_id (`user_id`)
   21                                     ) ENGINE=MyISAM;");
   22         
   23         $this->announce("done.");
   24         
   25     }
   26     
   27     public function down ()
   28     {
   29         $this->announce(" removing table...");
   30         DBManager::get()->exec("DROP TABLE `user_token`");
   31         
   32         $this->announce("done.");
   33         
   34     }
   35 }