This repository has been archived on 2023-07-28. You can view files and clone it, but cannot push or open issues or pull requests.
prosody_web_admin_rest/data/migrations/20160710194830_UsersRegisteredTable.php

35 lines
680 B
PHP
Raw Normal View History

<?php
use Phpmig\Migration\Migration;
class UsersRegisteredTable extends Migration
{
public $tableName = 'users_registered'; // Table name
public $db;
/**
* Do the migration
*/
public function up()
{
$this->db->create($this->tableName, function($table) {
$table->string('username')->unique()->primary();
$table->string('delete_code', 64);
});
}
/**
* Undo the migration
*/
public function down()
{
$this->db->dropIfExists($this->tableName);
}
/**
* Init the migration
*/
public function init()
{
$this->db = $this->container['schema'];
}
}