startSetup(); /** * Create table 'klarna_payments_quote' */ $table = $installer->getConnection() ->newTable($installer->getTable('klarna_payments_quote')) ->addColumn( 'payments_quote_id', Table::TYPE_INTEGER, null, [ 'identity' => true, 'unsigned' => true, 'nullable' => false, 'primary' => true, ], 'Payments Id' ) ->addColumn( 'session_id', Table::TYPE_TEXT, 255, [], 'Klarna Session Id' ) ->addColumn( 'client_token', Table::TYPE_TEXT, '64k', [], 'Klarna Client Token' ) ->addColumn( 'authorization_token', Table::TYPE_TEXT, 255, [], 'Authorization Token' ) ->addColumn( 'is_active', Table::TYPE_SMALLINT, null, [ 'nullable' => false, 'default' => '0', ], 'Is Active' ) ->addColumn( 'quote_id', Table::TYPE_INTEGER, null, [ 'unsigned' => true, 'nullable' => false, ], 'Quote Id' ) ->addForeignKey( $installer->getFkName( 'klarna_payments_quote', 'quote_id', 'quote', 'entity_id' ), 'quote_id', $installer->getTable('quote'), 'entity_id', Table::ACTION_CASCADE ) ->setComment('Klarna Payments Quote'); $installer->getConnection()->createTable($table); $installer->endSetup(); } }