Location of SQL scripts for file based assay module

LabKey Support Forum (Inactive)
Location of SQL scripts for file based assay module Will Holtz  2014-06-24 09:35
Status: Closed
 
I am trying to develop a file based assay module. I would like a few of the fields in the results and run tables to be foreign keys to some additional tables within the module. Creating the additional tables would appear to be a task for an SQL script. However in the assay file tree (https://www.labkey.org/wiki/home/Documentation/page.view?name=moduleDirectoryStructures), there is not a directory for SQL scripts within assay modules. Is it possible to use SQL scripts within file based assay modules? An old reply by kevink (https://www.labkey.org/announcements/home/Developer/Forum/thread.view?rowId=7792) implies it is possible. If it is possible, where should the SQL script be placed?

And am I required to write SQL scripts for both Postgres and SQL server? I'm doubtful that my custom module will ever be used by anyone else, and I'm sticking with Postgres.

thanks!
-Will
 
 
Greg Taylor responded:  2014-06-24 09:58
Yes, you may define database scripts in your file based module. See the dbscripts directory in the documentation linked below. Generally, you would define parallel scrips for both MicroSoft SQL and Postgres but this is not strictly required if your module will only be used on your system.

https://www.labkey.org/wiki/home/Documentation/page.view?name=moduleDirectoryStructures

Greg
 
kevink responded:  2014-06-24 12:51
As Greg says, you can add database SQL upgrade scripts in a module, but we don't support adding database SQL scripts for an assay type.

You don't need to write PostgreSQL and SqlServer scripts if you only intend to support one. To indicate that your module only will run on a particular database, add "SupportedDatabases: pgsql" or "SupportedDatabases: mssql" to your module.properties file.