Page 1 of 1
Getting module ready for deployment
Posted: Sat Jan 18, 2014 5:46 pm
by hallsofvallhalla
So I have Halls Map ready for testing but I am trying to export it and turn it into a package. Everything is working except the tables are not being created. How do I get the importer to run the install.sql?
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 6:28 pm
by KyleMassacre
Dump the db data in a file called install.sql and add that into the module directory.
The install.sql file will run automatically for first time installations during the install procedure then every upgrade you do after that which alters the db you create a new file called upgrade_<version>.sql please note that you must replace your "." with "_" so for example:
upgrade_1_7_0.sql
then just append what you added to your upgrade to your install.sql
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 6:52 pm
by hallsofvallhalla
i have done all that, maybe I am getting a sql error then in the file. It shows module installed successfully but the new tables do not show up.
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 7:01 pm
by KyleMassacre
that is really odd. normally if there is an error it will show it. But I have never seen a syntax error on an install.sql file off the top of my head. I would just do a direct export and remlve all the garbage it gives and paste it in your file
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 7:03 pm
by hallsofvallhalla
I did have one error in the sql, I fixed it then pasted the code in phpmyadmin and it runs perfectly.
Is there something I am suppose to add to the config file?
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 7:09 pm
by KyleMassacre
well now that all depends on quite a few things. There are a lot of features and powers config.xml has. I nust got done with a rough draft on a tuorial for it myself and il will be happy to share it with you
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 7:17 pm
by hallsofvallhalla
but does anything to do with adding new tables require it? That is the only thing not working. I can import the sql file directly and it works so it must be the module not seeing it.
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 7:21 pm
by KyleMassacre
no you don't need anything special for it to import the file in the xml. did you try the update module? I really don't think that would make it work but you could give it a shot
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 7:57 pm
by hallsofvallhalla
i took your advice and exported each table then inserted that code into install.sql and it worked.
Thanks for the help!
Re: Getting module ready for deployment
Posted: Sat Jan 18, 2014 10:10 pm
by a_bertrand
the install.sql will not run after you already installed once the module. Why? because it would create an error if you try to create multiple times the same tables for example. Therefore after the first installation the engine looks for "upgrade-X_Y_Z.sql".
BTW The information about which version of a module is currently installed is stored in the modules table. If you delete the row which have the name of the module, and then try to run the installer, it shall run the install.sql file.