Getting module ready for deployment

General Chat, Comments
Post Reply
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Getting module ready for deployment

Post 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?
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Getting module ready for deployment

Post 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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Getting module ready for deployment

Post 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.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Getting module ready for deployment

Post 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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Getting module ready for deployment

Post 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?
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Getting module ready for deployment

Post 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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Getting module ready for deployment

Post 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.
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Getting module ready for deployment

Post 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
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Getting module ready for deployment

Post by hallsofvallhalla »

i took your advice and exported each table then inserted that code into install.sql and it worked.

Thanks for the help!
User avatar
a_bertrand
Posts: 1536
Joined: Mon Feb 25, 2013 1:46 pm

Re: Getting module ready for deployment

Post 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.
Creator of Dot World Maker
Mad programmer and annoying composer
Post Reply

Return to “General”