Jump to content

Can we add multiple database tables while module installation in prestashop 1.7


Venky967

Recommended Posts

In order to create a database table I have a function like this

 

public function installDb()

{

return (Db::getInstance()->execute('

CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'sampletable` (

`id` int(10) unsigned NOT NULL AUTO_INCREMENT,

`username` varchar(50) NOT NULL,

`password` varchar(255) NOT NULL,

PRIMARY KEY (`id`),

UNIQUE KEY `TRANSUNION_CONFIGURE_DETAILS_USERNAME` (`username`)

) ENGINE = '._MYSQL_ENGINE_.' CHARACTER SET utf8 COLLATE utf8_general_ci;'));

}

 

By doing this ,after my module installation a single table named "sampletable" is created.Now I want multiple tables to be created.How to achieve it?

Thank you.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...