Getting module ready for deployment
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Getting module ready for deployment
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?
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Getting module ready for deployment
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
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
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Getting module ready for deployment
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.
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Getting module ready for deployment
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
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Getting module ready for deployment
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?
Is there something I am suppose to add to the config file?
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Getting module ready for deployment
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
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Getting module ready for deployment
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.
- KyleMassacre
- Posts: 573
- Joined: Wed Nov 27, 2013 12:42 pm
Re: Getting module ready for deployment
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
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Getting module ready for deployment
i took your advice and exported each table then inserted that code into install.sql and it worked.
Thanks for the help!
Thanks for the help!
- a_bertrand
- Posts: 1536
- Joined: Mon Feb 25, 2013 1:46 pm
Re: Getting module ready for deployment
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.
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.
Creator of Dot World Maker
Mad programmer and annoying composer
Mad programmer and annoying composer