Welcome Guest, Not a member yet? Register   Sign In
Creating migrations with schemas in sqlsrv and forge
#1

In the development branch there is already the sqlsrv database manager, however I have not managed to create tables within schemas using the codeigniter forge, on the other hand in the model if I define the name of the table as schema.name it works. Anyone have any idea how to create the migrations for sqlsrv using schemas?


PHP Code:
public function up()
    {
        
$fields = [

            'id'          => [
                'type'           => 'INT',
                'constraint'     => 5,
                'unsigned'       => true,
                'auto_increment' => true
            
],
            'name'       => [
                'type'           => 'VARCHAR',
                'constraint'     => '100',
            ],
            'description' => [
                'type'           => 'TEXT',
                'null'           => true,
            ]
        ];

        $this->forge->addField($fields);
        $this->forge->addPrimaryKey('id');
        $this->forge->addUniqueKey('name');
        $this->forge->createTable('adm.status');

Hernan Rodríguez
[email protected]
Reply


Messages In This Thread
Creating migrations with schemas in sqlsrv and forge - by Hrodriguez18 - 11-07-2020, 04:02 PM



Theme © iAndrew 2016 - Forum software by © MyBB