Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 7 commits
  • 144 files changed
  • 0 commit comments
  • 2 contributors
Commits on May 21, 2012
Ray Miller Initial release. b2572d1
Commits on May 29, 2012
Ray Miller Implement user admin functions. 0d645af
Commits on Jun 15, 2012
Ray Miller Build results of bd05253 on devel bd8f89a
Commits on Jul 12, 2012
@sajp sajp Implement plate and well tracking
   Implement browse interface for qc-runs
   Implement reporting framework
73e4083
Commits on Jul 13, 2012
Ray Miller Tighten up LIMS2::Model::FormValidator::Constraint::integer.
   Don't display the welcome paragarph in an alert div.
c8dcda2
Ray Miller Bugfix LIMS2::Model::software_version(). daeb081
Commits on Jul 17, 2012
Ray Miller Implement plate list and view.
   Implement well relations view.
671b8dc
Showing with 1,518 additions and 2,445 deletions.
  1. +0 −6 .gitignore
  2. +1 −1  Changes
  3. +379 −0 LICENSE
  4. +222 −0 MANIFEST
  5. +110 −0 META.yml
  6. +13 −0 README
  7. +0 −12 ddl/generate-schema.sh
  8. +0 −18 ddl/templates/roles.sql
  9. +0 −11 ddl/templates/schema.sql
  10. +0 −5 ddl/templates/test_roles.sql
  11. +0 −428 ddl/templates/versions/1/audit-up.sql
  12. +0 −6 ddl/templates/versions/1/fixtures.sql
  13. +0 −173 ddl/templates/versions/1/up.sql
  14. +0 −31 ddl/templates/versions/2/audit-up.sql
  15. +0 −1  ddl/templates/versions/2/fixtures.sql
  16. +0 −1  ddl/templates/versions/2/roles.sql
  17. +0 −31 ddl/templates/versions/2/up.sql
  18. +0 −409 ddl/templates/versions/3/audit-up.sql
  19. +0 −39 ddl/templates/versions/3/fixtures.sql
  20. +0 −154 ddl/templates/versions/3/up.sql
  21. +0 −60 ddl/templates/versions/4/audit-up.sql
  22. +0 −2  ddl/templates/versions/4/fixtures.sql
  23. +0 −34 ddl/templates/versions/4/up.sql
  24. +0 −643 ddl/templates/versions/5/audit-up.sql
  25. +0 −105 ddl/templates/versions/5/fixtures.sql
  26. +0 −219 ddl/templates/versions/5/up.sql
  27. +0 −28 ddl/vars.tt
  28. +0 −28 dist.ini
  29. +6 −0 lib/LIMS2/Catalyst/Controller/REST.pm
  30. +6 −0 lib/LIMS2/Model.pm
  31. +6 −0 lib/LIMS2/Model/AuthDB.pm
  32. +6 −0 lib/LIMS2/Model/Constants.pm
  33. +6 −0 lib/LIMS2/Model/DBConnect.pm
  34. +6 −0 lib/LIMS2/Model/FormValidator.pm
  35. +6 −0 lib/LIMS2/Model/FormValidator/Constraint.pm
  36. +6 −0 lib/LIMS2/Model/Plugin/BAC.pm
  37. +6 −0 lib/LIMS2/Model/Plugin/Design.pm
  38. +6 −0 lib/LIMS2/Model/Plugin/Gene.pm
  39. +6 −0 lib/LIMS2/Model/Plugin/Plate.pm
  40. +6 −0 lib/LIMS2/Model/Plugin/Process.pm
  41. +6 −0 lib/LIMS2/Model/Plugin/QC.pm
  42. +6 −0 lib/LIMS2/Model/Plugin/User.pm
  43. +6 −0 lib/LIMS2/Model/Plugin/Well.pm
  44. +6 −0 lib/LIMS2/Model/ProcessGraph.pm
  45. +6 −0 lib/LIMS2/Model/Schema.pm
  46. +6 −0 lib/LIMS2/Model/Schema/Result/Assembly.pm
  47. +6 −0 lib/LIMS2/Model/Schema/Result/BacClone.pm
  48. +6 −0 lib/LIMS2/Model/Schema/Result/BacCloneLocus.pm
  49. +6 −0 lib/LIMS2/Model/Schema/Result/BacLibrary.pm
  50. +6 −0 lib/LIMS2/Model/Schema/Result/Backbone.pm
  51. +6 −0 lib/LIMS2/Model/Schema/Result/Cassette.pm
  52. +6 −0 lib/LIMS2/Model/Schema/Result/Chromosome.pm
  53. +6 −0 lib/LIMS2/Model/Schema/Result/Design.pm
  54. +6 −0 lib/LIMS2/Model/Schema/Result/DesignComment.pm
  55. +6 −0 lib/LIMS2/Model/Schema/Result/DesignCommentCategory.pm
  56. +6 −0 lib/LIMS2/Model/Schema/Result/DesignOligo.pm
  57. +6 −0 lib/LIMS2/Model/Schema/Result/DesignOligoLocus.pm
  58. +6 −0 lib/LIMS2/Model/Schema/Result/DesignOligoLocusNCBIM37.pm
  59. +6 −0 lib/LIMS2/Model/Schema/Result/DesignOligoType.pm
  60. +6 −0 lib/LIMS2/Model/Schema/Result/DesignType.pm
  61. +6 −0 lib/LIMS2/Model/Schema/Result/GeneDesign.pm
  62. +6 −0 lib/LIMS2/Model/Schema/Result/GenotypingPrimer.pm
  63. +6 −0 lib/LIMS2/Model/Schema/Result/GenotypingPrimerType.pm
  64. +6 −0 lib/LIMS2/Model/Schema/Result/Plate.pm
  65. +6 −0 lib/LIMS2/Model/Schema/Result/PlateComment.pm
  66. +6 −0 lib/LIMS2/Model/Schema/Result/PlateType.pm
  67. +6 −0 lib/LIMS2/Model/Schema/Result/Process.pm
  68. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessBac.pm
  69. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessBackbone.pm
  70. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessCassette.pm
  71. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessDesign.pm
  72. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessInputWell.pm
  73. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessOutputWell.pm
  74. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessRecombinase.pm
  75. +6 −0 lib/LIMS2/Model/Schema/Result/ProcessType.pm
  76. +6 −0 lib/LIMS2/Model/Schema/Result/QcAlignment.pm
  77. +6 −0 lib/LIMS2/Model/Schema/Result/QcAlignmentRegion.pm
  78. +6 −0 lib/LIMS2/Model/Schema/Result/QcEngSeq.pm
  79. +6 −0 lib/LIMS2/Model/Schema/Result/QcRun.pm
  80. +6 −0 lib/LIMS2/Model/Schema/Result/QcRunSeqProject.pm
  81. +6 −0 lib/LIMS2/Model/Schema/Result/QcRunSeqWell.pm
  82. +6 −0 lib/LIMS2/Model/Schema/Result/QcRunSeqWellQcSeqRead.pm
  83. +6 −0 lib/LIMS2/Model/Schema/Result/QcSeqProject.pm
  84. +6 −0 lib/LIMS2/Model/Schema/Result/QcSeqRead.pm
  85. +6 −0 lib/LIMS2/Model/Schema/Result/QcTemplate.pm
  86. +6 −0 lib/LIMS2/Model/Schema/Result/QcTemplateWell.pm
  87. +6 −0 lib/LIMS2/Model/Schema/Result/QcTestResult.pm
  88. +6 −0 lib/LIMS2/Model/Schema/Result/Recombinase.pm
  89. +6 −0 lib/LIMS2/Model/Schema/Result/RecombineeringResultType.pm
  90. +6 −0 lib/LIMS2/Model/Schema/Result/Role.pm
  91. +6 −0 lib/LIMS2/Model/Schema/Result/SchemaVersion.pm
  92. +6 −0 lib/LIMS2/Model/Schema/Result/User.pm
  93. +6 −0 lib/LIMS2/Model/Schema/Result/UserRole.pm
  94. +6 −0 lib/LIMS2/Model/Schema/Result/Well.pm
  95. +6 −0 lib/LIMS2/Model/Schema/Result/WellAcceptedOverride.pm
  96. +6 −0 lib/LIMS2/Model/Schema/Result/WellComment.pm
  97. +6 −0 lib/LIMS2/Model/Schema/Result/WellDnaQuality.pm
  98. +6 −0 lib/LIMS2/Model/Schema/Result/WellDnaStatus.pm
  99. +6 −0 lib/LIMS2/Model/Schema/Result/WellQcSequencingResult.pm
  100. +6 −0 lib/LIMS2/Model/Schema/Result/WellRecombineeringResult.pm
  101. +6 −0 lib/LIMS2/Model/Types.pm
  102. +6 −0 lib/LIMS2/Model/Util.pm
  103. +6 −0 lib/LIMS2/Model/Util/ComputeAcceptedStatus.pm
  104. +6 −0 lib/LIMS2/Model/Util/PgUserRole.pm
  105. +6 −0 lib/LIMS2/Model/Util/QCResults.pm
  106. +6 −0 lib/LIMS2/Model/Util/WellName.pm
  107. +6 −0 lib/LIMS2/Report.pm
  108. +6 −0 lib/LIMS2/Report/DNAPlate.pm
  109. +6 −0 lib/LIMS2/Report/DesignPlate.pm
  110. +6 −0 lib/LIMS2/Report/FinalVectorPlate.pm
  111. +6 −0 lib/LIMS2/Report/IntermediateVectorPlate.pm
  112. +6 −0 lib/LIMS2/Report/PostIntermediateVectorPlate.pm
  113. +6 −0 lib/LIMS2/Report/QcRun.pm
  114. +6 −0 lib/LIMS2/Report/QcRunSummary.pm
  115. +6 −0 lib/LIMS2/Report/VectorProductionDetail.pm
  116. +6 −0 lib/LIMS2/Report/VectorProductionSummary.pm
  117. +6 −0 lib/LIMS2/Role/PlateReportGenerator.pm
  118. +6 −0 lib/LIMS2/Role/ReportGenerator.pm
  119. +6 −0 lib/LIMS2/Test.pm
  120. +6 −0 lib/LIMS2/WebApp.pm
  121. +6 −0 lib/LIMS2/WebApp/Controller/API.pm
  122. +6 −0 lib/LIMS2/WebApp/Controller/API/AutoComplete.pm
  123. +6 −0 lib/LIMS2/WebApp/Controller/API/Design.pm
  124. +6 −0 lib/LIMS2/WebApp/Controller/API/PlateWell.pm
  125. +6 −0 lib/LIMS2/WebApp/Controller/API/QC.pm
  126. +6 −0 lib/LIMS2/WebApp/Controller/API/Report.pm
  127. +6 −0 lib/LIMS2/WebApp/Controller/Admin.pm
  128. +6 −0 lib/LIMS2/WebApp/Controller/Auth.pm
  129. +6 −0 lib/LIMS2/WebApp/Controller/Root.pm
  130. +6 −0 lib/LIMS2/WebApp/Controller/User.pm
  131. +6 −0 lib/LIMS2/WebApp/Controller/User/BrowseDesigns.pm
  132. +6 −0 lib/LIMS2/WebApp/Controller/User/BrowsePlates.pm
  133. +6 −0 lib/LIMS2/WebApp/Controller/User/Graph.pm
  134. +6 −0 lib/LIMS2/WebApp/Controller/User/QC.pm
  135. +6 −0 lib/LIMS2/WebApp/Controller/User/Report.pm
  136. +6 −0 lib/LIMS2/WebApp/Controller/User/Report/Gene.pm
  137. +6 −0 lib/LIMS2/WebApp/Model/AuthDB.pm
  138. +6 −0 lib/LIMS2/WebApp/Model/Golgi.pm
  139. +6 −0 lib/LIMS2/WebApp/Pageset.pm
  140. +6 −0 lib/LIMS2/WebApp/Script/FastCGI.pm
  141. +6 −0 lib/LIMS2/WebApp/View/HTML.pm
  142. +73 −0 t/00-compile.t
  143. +20 −0 t/author-critic.t
  144. +22 −0 t/release-no-smart-comments.t
View
6 .gitignore
@@ -1,6 +0,0 @@
-.build
-LIMS2-WebApp-*
-ddl/lims2_devel
-ddl/lims2_test
-ddl/lims2_live
-ddl/lims2_staging
View
2  Changes
@@ -1,4 +1,4 @@
-{{$NEXT}}
+0.007 2012-07-17 10:03:50 Europe/London
Implement plate list and view.
Implement well relations view.
View
379 LICENSE
@@ -0,0 +1,379 @@
+This software is copyright (c) 2012 by Genome Research Ltd.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+Terms of the Perl programming language system itself
+
+a) the GNU General Public License as published by the Free
+ Software Foundation; either version 1, or (at your option) any
+ later version, or
+b) the "Artistic License"
+
+--- The GNU General Public License, Version 1, February 1989 ---
+
+This software is Copyright (c) 2012 by Genome Research Ltd.
+
+This is free software, licensed under:
+
+ The GNU General Public License, Version 1, February 1989
+
+ GNU GENERAL PUBLIC LICENSE
+ Version 1, February 1989
+
+ Copyright (C) 1989 Free Software Foundation, Inc.
+ 51 Franklin St, Suite 500, Boston, MA 02110-1335 USA
+
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The license agreements of most software companies try to keep users
+at the mercy of those companies. By contrast, our General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. The
+General Public License applies to the Free Software Foundation's
+software and to any other program whose authors commit to using it.
+You can use it for your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Specifically, the General Public License is designed to make
+sure that you have the freedom to give away or sell copies of free
+software, that you receive source code or can get it if you want it,
+that you can change the software or use pieces of it in new free
+programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of a such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must tell them their rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any program or other work which
+contains a notice placed by the copyright holder saying it may be
+distributed under the terms of this General Public License. The
+"Program", below, refers to any such program or work, and a "work based
+on the Program" means either the Program or any work containing the
+Program or a portion of it, either verbatim or with modifications. Each
+licensee is addressed as "you".
+
+ 1. You may copy and distribute verbatim copies of the Program's source
+code as you receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice and
+disclaimer of warranty; keep intact all the notices that refer to this
+General Public License and to the absence of any warranty; and give any
+other recipients of the Program a copy of this General Public License
+along with the Program. You may charge a fee for the physical act of
+transferring a copy.
+
+ 2. You may modify your copy or copies of the Program or any portion of
+it, and copy and distribute such modifications under the terms of Paragraph
+1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating that
+ you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish, that
+ in whole or in part contains the Program or any part thereof, either
+ with or without modifications, to be licensed at no charge to all
+ third parties under the terms of this General Public License (except
+ that you may choose to grant warranty protection to some or all
+ third parties, at your option).
+
+ c) If the modified program normally reads commands interactively when
+ run, you must cause it, when started running for such interactive use
+ in the simplest and most usual way, to print or display an
+ announcement including an appropriate copyright notice and a notice
+ that there is no warranty (or else, saying that you provide a
+ warranty) and that users may redistribute the program under these
+ conditions, and telling the user how to view a copy of this General
+ Public License.
+
+ d) You may charge a fee for the physical act of transferring a
+ copy, and you may at your option offer warranty protection in
+ exchange for a fee.
+
+Mere aggregation of another independent work with the Program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other work under the scope of these terms.
+
+ 3. You may copy and distribute the Program (or a portion or derivative of
+it, under Paragraph 2) in object code or executable form under the terms of
+Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal charge
+ for the cost of distribution) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+Source code for a work means the preferred form of the work for making
+modifications to it. For an executable file, complete source code means
+all the source code for all modules it contains; but, as a special
+exception, it need not include source code for modules which are standard
+libraries that accompany the operating system on which the executable
+file runs, or for standard header files or definitions files that
+accompany that operating system.
+
+ 4. You may not copy, modify, sublicense, distribute or transfer the
+Program except as expressly provided under this General Public License.
+Any attempt otherwise to copy, modify, sublicense, distribute or transfer
+the Program is void, and will automatically terminate your rights to use
+the Program under this License. However, parties who have received
+copies, or rights to use copies, from you under this General Public
+License will not have their licenses terminated so long as such parties
+remain in full compliance.
+
+ 5. By copying, distributing or modifying the Program (or any work based
+on the Program) you indicate your acceptance of this license to do so,
+and all its terms and conditions.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the original
+licensor to copy, distribute or modify the Program subject to these
+terms and conditions. You may not impose any further restrictions on the
+recipients' exercise of the rights granted herein.
+
+ 7. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of the license which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+the license, you may choose any version ever published by the Free Software
+Foundation.
+
+ 8. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to humanity, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these
+terms.
+
+ To do so, attach the following notices to the program. It is safest to
+attach them to the start of each source file to most effectively convey
+the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19xx name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the
+appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than `show w' and `show
+c'; they could even be mouse-clicks or menu items--whatever suits your
+program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ program `Gnomovision' (a program to direct compilers to make passes
+ at assemblers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
+
+--- The Artistic License 1.0 ---
+
+This software is Copyright (c) 2012 by Genome Research Ltd.
+
+This is free software, licensed under:
+
+ The Artistic License 1.0
+
+The Artistic License
+
+Preamble
+
+The intent of this document is to state the conditions under which a Package
+may be copied, such that the Copyright Holder maintains some semblance of
+artistic control over the development of the package, while giving the users of
+the package the right to use and distribute the Package in a more-or-less
+customary fashion, plus the right to make reasonable modifications.
+
+Definitions:
+
+ - "Package" refers to the collection of files distributed by the Copyright
+ Holder, and derivatives of that collection of files created through
+ textual modification.
+ - "Standard Version" refers to such a Package if it has not been modified,
+ or has been modified in accordance with the wishes of the Copyright
+ Holder.
+ - "Copyright Holder" is whoever is named in the copyright or copyrights for
+ the package.
+ - "You" is you, if you're thinking about copying or distributing this Package.
+ - "Reasonable copying fee" is whatever you can justify on the basis of media
+ cost, duplication charges, time of people involved, and so on. (You will
+ not be required to justify it to the Copyright Holder, but only to the
+ computing community at large as a market that must bear the fee.)
+ - "Freely Available" means that no fee is charged for the item itself, though
+ there may be fees involved in handling the item. It also means that
+ recipients of the item may redistribute it under the same conditions they
+ received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications derived
+from the Public Domain or from the Copyright Holder. A Package modified in such
+a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided that
+you insert a prominent notice in each changed file stating how and when you
+changed that file, and provided that you do at least ONE of the following:
+
+ a) place your modifications in the Public Domain or otherwise make them
+ Freely Available, such as by posting said modifications to Usenet or an
+ equivalent medium, or placing the modifications on a major archive site
+ such as ftp.uu.net, or by allowing the Copyright Holder to include your
+ modifications in the Standard Version of the Package.
+
+ b) use the modified Package only within your corporation or organization.
+
+ c) rename any non-standard executables so the names do not conflict with
+ standard executables, which must also be provided, and provide a separate
+ manual page for each non-standard executable that clearly documents how it
+ differs from the Standard Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or executable
+form, provided that you do at least ONE of the following:
+
+ a) distribute a Standard Version of the executables and library files,
+ together with instructions (in the manual page or equivalent) on where to
+ get the Standard Version.
+
+ b) accompany the distribution with the machine-readable source of the Package
+ with your modifications.
+
+ c) accompany any non-standard executables with their corresponding Standard
+ Version executables, giving the non-standard executables non-standard
+ names, and clearly documenting the differences in manual pages (or
+ equivalent), together with instructions on where to get the Standard
+ Version.
+
+ d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package. You may charge any fee you choose for support of this Package. You
+may not charge a fee for this Package itself. However, you may distribute this
+Package in aggregate with other (possibly commercial) programs as part of a
+larger (possibly commercial) software distribution provided that you do not
+advertise this Package as a product of your own.
+
+6. The scripts and library files supplied as input to or produced as output
+from the programs of this Package do not automatically fall under the copyright
+of this Package, but belong to whomever generated them, and may be sold
+commercially, and may be aggregated with this Package.
+
+7. C or perl subroutines supplied by you and linked into this Package shall not
+be considered part of this Package.
+
+8. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+
View
222 MANIFEST
@@ -0,0 +1,222 @@
+Changes
+LICENSE
+MANIFEST
+META.yml
+Makefile.PL
+README
+bin/final_vector_report.pl
+bin/lims2_create_users.pl
+bin/lims2_model_dump_schema.pl
+bin/process_graph.pl
+lib/LIMS2/Catalyst/Controller/REST.pm
+lib/LIMS2/Model.pm
+lib/LIMS2/Model/AuthDB.pm
+lib/LIMS2/Model/Constants.pm
+lib/LIMS2/Model/DBConnect.pm
+lib/LIMS2/Model/FormValidator.pm
+lib/LIMS2/Model/FormValidator/Constraint.pm
+lib/LIMS2/Model/Plugin/BAC.pm
+lib/LIMS2/Model/Plugin/Design.pm
+lib/LIMS2/Model/Plugin/Gene.pm
+lib/LIMS2/Model/Plugin/Plate.pm
+lib/LIMS2/Model/Plugin/Process.pm
+lib/LIMS2/Model/Plugin/QC.pm
+lib/LIMS2/Model/Plugin/User.pm
+lib/LIMS2/Model/Plugin/Well.pm
+lib/LIMS2/Model/ProcessGraph.pm
+lib/LIMS2/Model/Schema.pm
+lib/LIMS2/Model/Schema/Result/Assembly.pm
+lib/LIMS2/Model/Schema/Result/BacClone.pm
+lib/LIMS2/Model/Schema/Result/BacCloneLocus.pm
+lib/LIMS2/Model/Schema/Result/BacLibrary.pm
+lib/LIMS2/Model/Schema/Result/Backbone.pm
+lib/LIMS2/Model/Schema/Result/Cassette.pm
+lib/LIMS2/Model/Schema/Result/Chromosome.pm
+lib/LIMS2/Model/Schema/Result/Design.pm
+lib/LIMS2/Model/Schema/Result/DesignComment.pm
+lib/LIMS2/Model/Schema/Result/DesignCommentCategory.pm
+lib/LIMS2/Model/Schema/Result/DesignOligo.pm
+lib/LIMS2/Model/Schema/Result/DesignOligoLocus.pm
+lib/LIMS2/Model/Schema/Result/DesignOligoLocusNCBIM37.pm
+lib/LIMS2/Model/Schema/Result/DesignOligoType.pm
+lib/LIMS2/Model/Schema/Result/DesignType.pm
+lib/LIMS2/Model/Schema/Result/GeneDesign.pm
+lib/LIMS2/Model/Schema/Result/GenotypingPrimer.pm
+lib/LIMS2/Model/Schema/Result/GenotypingPrimerType.pm
+lib/LIMS2/Model/Schema/Result/Plate.pm
+lib/LIMS2/Model/Schema/Result/PlateComment.pm
+lib/LIMS2/Model/Schema/Result/PlateType.pm
+lib/LIMS2/Model/Schema/Result/Process.pm
+lib/LIMS2/Model/Schema/Result/ProcessBac.pm
+lib/LIMS2/Model/Schema/Result/ProcessBackbone.pm
+lib/LIMS2/Model/Schema/Result/ProcessCassette.pm
+lib/LIMS2/Model/Schema/Result/ProcessDesign.pm
+lib/LIMS2/Model/Schema/Result/ProcessInputWell.pm
+lib/LIMS2/Model/Schema/Result/ProcessOutputWell.pm
+lib/LIMS2/Model/Schema/Result/ProcessRecombinase.pm
+lib/LIMS2/Model/Schema/Result/ProcessType.pm
+lib/LIMS2/Model/Schema/Result/QcAlignment.pm
+lib/LIMS2/Model/Schema/Result/QcAlignmentRegion.pm
+lib/LIMS2/Model/Schema/Result/QcEngSeq.pm
+lib/LIMS2/Model/Schema/Result/QcRun.pm
+lib/LIMS2/Model/Schema/Result/QcRunSeqProject.pm
+lib/LIMS2/Model/Schema/Result/QcRunSeqWell.pm
+lib/LIMS2/Model/Schema/Result/QcRunSeqWellQcSeqRead.pm
+lib/LIMS2/Model/Schema/Result/QcSeqProject.pm
+lib/LIMS2/Model/Schema/Result/QcSeqRead.pm
+lib/LIMS2/Model/Schema/Result/QcTemplate.pm
+lib/LIMS2/Model/Schema/Result/QcTemplateWell.pm
+lib/LIMS2/Model/Schema/Result/QcTestResult.pm
+lib/LIMS2/Model/Schema/Result/Recombinase.pm
+lib/LIMS2/Model/Schema/Result/RecombineeringResultType.pm
+lib/LIMS2/Model/Schema/Result/Role.pm
+lib/LIMS2/Model/Schema/Result/SchemaVersion.pm
+lib/LIMS2/Model/Schema/Result/User.pm
+lib/LIMS2/Model/Schema/Result/UserRole.pm
+lib/LIMS2/Model/Schema/Result/Well.pm
+lib/LIMS2/Model/Schema/Result/WellAcceptedOverride.pm
+lib/LIMS2/Model/Schema/Result/WellComment.pm
+lib/LIMS2/Model/Schema/Result/WellDnaQuality.pm
+lib/LIMS2/Model/Schema/Result/WellDnaStatus.pm
+lib/LIMS2/Model/Schema/Result/WellQcSequencingResult.pm
+lib/LIMS2/Model/Schema/Result/WellRecombineeringResult.pm
+lib/LIMS2/Model/Types.pm
+lib/LIMS2/Model/Util.pm
+lib/LIMS2/Model/Util/ComputeAcceptedStatus.pm
+lib/LIMS2/Model/Util/PgUserRole.pm
+lib/LIMS2/Model/Util/QCResults.pm
+lib/LIMS2/Model/Util/WellName.pm
+lib/LIMS2/Report.pm
+lib/LIMS2/Report/DNAPlate.pm
+lib/LIMS2/Report/DesignPlate.pm
+lib/LIMS2/Report/FinalVectorPlate.pm
+lib/LIMS2/Report/IntermediateVectorPlate.pm
+lib/LIMS2/Report/PostIntermediateVectorPlate.pm
+lib/LIMS2/Report/QcRun.pm
+lib/LIMS2/Report/QcRunSummary.pm
+lib/LIMS2/Report/VectorProductionDetail.pm
+lib/LIMS2/Report/VectorProductionSummary.pm
+lib/LIMS2/Role/PlateReportGenerator.pm
+lib/LIMS2/Role/ReportGenerator.pm
+lib/LIMS2/Test.pm
+lib/LIMS2/WebApp.pm
+lib/LIMS2/WebApp/Controller/API.pm
+lib/LIMS2/WebApp/Controller/API/AutoComplete.pm
+lib/LIMS2/WebApp/Controller/API/Design.pm
+lib/LIMS2/WebApp/Controller/API/PlateWell.pm
+lib/LIMS2/WebApp/Controller/API/QC.pm
+lib/LIMS2/WebApp/Controller/API/Report.pm
+lib/LIMS2/WebApp/Controller/Admin.pm
+lib/LIMS2/WebApp/Controller/Auth.pm
+lib/LIMS2/WebApp/Controller/Root.pm
+lib/LIMS2/WebApp/Controller/User.pm
+lib/LIMS2/WebApp/Controller/User/BrowseDesigns.pm
+lib/LIMS2/WebApp/Controller/User/BrowsePlates.pm
+lib/LIMS2/WebApp/Controller/User/Graph.pm
+lib/LIMS2/WebApp/Controller/User/QC.pm
+lib/LIMS2/WebApp/Controller/User/Report.pm
+lib/LIMS2/WebApp/Controller/User/Report/Gene.pm
+lib/LIMS2/WebApp/Model/AuthDB.pm
+lib/LIMS2/WebApp/Model/Golgi.pm
+lib/LIMS2/WebApp/Pageset.pm
+lib/LIMS2/WebApp/Script/FastCGI.pm
+lib/LIMS2/WebApp/View/HTML.pm
+root/favicon.ico
+root/lib/navigation.tt
+root/lib/pagination.tt
+root/lib/wrapper.tt
+root/site/admin/create_user.tt
+root/site/admin/index.tt
+root/site/admin/update_user.tt
+root/site/auth/login.tt
+root/site/user/browsedesigns/index.tt
+root/site/user/browsedesigns/list_designs.tt
+root/site/user/browsedesigns/view_design.tt
+root/site/user/browseplates/index.tt
+root/site/user/browseplates/view.tt
+root/site/user/error.tt
+root/site/user/graph/index.tt
+root/site/user/index.tt
+root/site/user/qc/index.tt
+root/site/user/qc/view_qc_alignment.tt
+root/site/user/qc/view_qc_result.tt
+root/site/user/qc/view_qc_run.tt
+root/site/user/report/await_report.tt
+root/site/user/report/gene_report.tt
+root/site/user/report/simple_table.tt
+root/static/bootstrap/css/bootstrap.css
+root/static/bootstrap/css/bootstrap.min.css
+root/static/bootstrap/img/glyphicons-halflings-white.png
+root/static/bootstrap/img/glyphicons-halflings.png
+root/static/bootstrap/js/bootstrap.js
+root/static/bootstrap/js/bootstrap.min.js
+root/static/css/lims2.css
+root/static/images/btn_120x50_built.png
+root/static/images/btn_120x50_built_shadow.png
+root/static/images/btn_120x50_powered.png
+root/static/images/btn_120x50_powered_shadow.png
+root/static/images/btn_88x31_built.png
+root/static/images/btn_88x31_built_shadow.png
+root/static/images/btn_88x31_powered.png
+root/static/images/btn_88x31_powered_shadow.png
+root/static/images/catalyst_logo.png
+root/static/images/spinner-circle.gif
+root/static/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png
+root/static/jquery/css/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png
+root/static/jquery/css/ui-lightness/images/ui-bg_flat_10_000000_40x100.png
+root/static/jquery/css/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png
+root/static/jquery/css/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png
+root/static/jquery/css/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png
+root/static/jquery/css/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png
+root/static/jquery/css/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png
+root/static/jquery/css/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png
+root/static/jquery/css/ui-lightness/images/ui-icons_222222_256x240.png
+root/static/jquery/css/ui-lightness/images/ui-icons_228ef1_256x240.png
+root/static/jquery/css/ui-lightness/images/ui-icons_ef8c08_256x240.png
+root/static/jquery/css/ui-lightness/images/ui-icons_ffd27a_256x240.png
+root/static/jquery/css/ui-lightness/images/ui-icons_ffffff_256x240.png
+root/static/jquery/css/ui-lightness/jquery-ui-1.8.21.custom.css
+root/static/jquery/js/jquery-ui-1.8.21.custom.min.js
+root/static/js/jquery-1.7.2.min.js
+root/static/js/poller.js
+script/lims2_webapp_cgi.pl
+script/lims2_webapp_create.pl
+script/lims2_webapp_fastcgi.pl
+script/lims2_webapp_server.pl
+script/lims2_webapp_test.pl
+t/00-compile.t
+t/10-dbconnect.t
+t/10-lims2-test.t
+t/20-form-validator.t
+t/50-model-plugin-bac.t
+t/50-model-plugin-design.t
+t/50-model-plugin-gene.t
+t/50-model-plugin-plate.t
+t/50-model-plugin-process.t
+t/50-model-plugin-qc.t
+t/50-model-plugin-user.t
+t/50-model-plugin-well.t
+t/80-login.t
+t/80-qc.t
+t/author-critic.t
+t/data/2w_gateway_process.yaml
+t/data/3w_gateway_process.yaml
+t/data/cre_bac_recom_process.yaml
+t/data/create_di_process.yaml
+t/data/dna_prep_process.yaml
+t/data/int_recom_process.yaml
+t/data/plate.yaml
+t/data/qc_run.yaml
+t/data/qc_seq_reads.yaml
+t/data/qc_template.yaml
+t/data/rearray_process.yaml
+t/data/recombinase_process.yaml
+t/data/well.yaml
+t/fixtures/00-clean-db.sql
+t/fixtures/10-users-roles.sql
+t/fixtures/20-constrained-vocab.sql
+t/fixtures/30-bacs.sql
+t/fixtures/30-designs.sql
+t/fixtures/40-qc.sql
+t/fixtures/50-plate-wells.sql
+t/release-no-smart-comments.t
View
110 META.yml
@@ -0,0 +1,110 @@
+---
+abstract: 'Catalyst based application'
+author:
+ - 'Wellcome Trust Sanger Institute'
+build_requires:
+ English: 0
+ File::Find: 0
+ File::Temp: 0
+ HTTP::Request::Common: 0
+ Test::More: 0.88
+ Test::Most: 0
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 4.300014, CPAN::Meta::Converter version 2.120921'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: LIMS2-WebApp
+requires:
+ Bio::Seq: 0
+ Bio::SeqIO: 0
+ CHI: 0
+ Carp: 0
+ Catalyst: 0
+ Catalyst::Controller: 0
+ Catalyst::Controller::REST: 0
+ Catalyst::Devel: 0
+ Catalyst::Model::Adaptor: 0
+ Catalyst::Model::DBIC::Schema: 0
+ Catalyst::Model::Factory::PerRequest: 0
+ Catalyst::Plugin::Authorization::Roles: 0
+ Catalyst::Plugin::Session::State::Cookie: 0
+ Catalyst::Plugin::Session::Store::FastMmap: 0
+ Catalyst::Plugin::Static::Simple: 0
+ Catalyst::Runtime: 5.80
+ Catalyst::Script::FastCGI: 0
+ Catalyst::View::TT: 0
+ Class::Data::Inheritable: 0
+ Config::Any: 0
+ Const::Fast: 0
+ Crypt::SaltedHash: 0
+ DBIx::Class::Core: 0
+ DBIx::Class::Schema: 0
+ DBIx::Class::Schema::Loader: 0
+ DBIx::Connector: 0
+ DBIx::RunSQL: 0
+ Data::Compare: 0
+ Data::Dump: 0
+ Data::FormValidator: 0
+ Data::Pageset: 0
+ Data::UUID: 0
+ DateTime: 0
+ DateTime::Format::ISO8601: 0
+ DateTime::Format::Pg: 0
+ DateTime::Format::Strptime: 0
+ EngSeqBuilder: 0
+ Exporter: 0
+ File::stat: 0
+ FindBin: 0
+ Getopt::Long: 0
+ GraphViz2: 0
+ HTGT::QC::Config: 0
+ HTGT::QC::Util::Alignment: 0
+ HTGT::QC::Util::CigarParser: 0
+ HTTP::Status: 0
+ Hash::MoreUtils: 0
+ IO::Pipe: 0
+ IO::String: 0
+ Iterator::Simple: 0
+ JSON: 0
+ LIMS2::Exception: 0
+ LIMS2::Exception::Database: 0
+ LIMS2::Exception::Implementation: 0
+ LIMS2::Exception::System: 0
+ LIMS2::Exception::Validation: 0
+ LIMS2::Util: 0
+ LIMS2::Util::EnsEMBL: 0
+ LIMS2::Util::Solr: 0
+ List::MoreUtils: 0
+ List::Util: 0
+ Log::Log4perl: 0
+ Log::Log4perl::Catalyst: 0
+ Module::Pluggable::Object: 0
+ Moose: 0
+ Moose::Role: 0
+ MooseX::Log::Log4perl: 0
+ MooseX::MarkAsMethods: 0
+ MooseX::NonMoose: 0
+ MooseX::Types: 0
+ MooseX::Types::Path::Class: 0
+ Path::Class: 0
+ Scalar::Util: 0
+ Sub::Exporter: 0
+ Template::AutoFilter: 0
+ Term::ReadPassword: 0
+ Test::More: 0
+ Test::WWW::Mechanize::Catalyst: 0
+ Text::CSV: 0
+ Try::Tiny: 0
+ TryCatch: 0
+ URI: 0
+ URI::QueryParam: 0
+ YAML::Any: 0
+ base: 0
+ namespace::autoclean: 0
+ overload: 0
+ strict: 0
+ utf8: 0
+ warnings: 0
+version: 0.007
View
13 README
@@ -0,0 +1,13 @@
+
+
+This archive contains the distribution LIMS2-WebApp,
+version 0.007:
+
+ Catalyst based application
+
+This software is copyright (c) 2012 by Genome Research Ltd.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+
View
12 ddl/generate-schema.sh
@@ -1,12 +0,0 @@
-#!/bin/bash
-
-DBNAME="$1"
-
-if test -z "$DBNAME"; then
- echo "Usage: $0 DBNAME" >&2
- exit 1
-fi
-
-exec ttree --plugin_base=LIMS2::Template::Plugin --recurse --lib . --pre_process vars.tt \
- --src templates --dest "$DBNAME" --define dbname="$DBNAME"
-
View
18 ddl/templates/roles.sql
@@ -1,18 +0,0 @@
-CREATE ROLE "[% admin_role %]" NOLOGIN NOINHERIT;
-CREATE ROLE "[% rw_role %]" NOLOGIN NOINHERIT;
-CREATE ROLE "[% ro_role %]" NOLOGIN NOINHERIT;
-CREATE ROLE "[% inter_role %]" NOLOGIN NOINHERIT IN ROLE "[% admin_role %]";
-CREATE ROLE "[% webapp_role %]" WITH ENCRYPTED PASSWORD '[% webapp_passwd %]' LOGIN NOINHERIT IN ROLE "[% ro_role %]";
-CREATE ROLE "[% webapp_ro_role %]" WITH ENCRYPTED PASSWORD '[% webapp_ro_passwd %]' LOGIN INHERIT IN ROLE "[% ro_role %]";
-CREATE ROLE "[% task_role %]" WITH ENCRYPTED PASSWORD '[% task_passwd %]' LOGIN INHERIT IN ROLE "[% rw_role %]";
-
-[%- FOR u IN webapp_users %]
-GRANT "[% rw_role %]" TO "[% u %]";
-GRANT "[% u %]" TO "[% webapp_role %]";
-[%- END %]
-
-[%- FOR u IN system_users %]
- [%- FOR r IN [ admin_role ro_role rw_role ] %]
-GRANT "[% r %]" TO "[% u %]";
- [%- END %]
-[%- END %]
View
11 ddl/templates/schema.sql
@@ -1,11 +0,0 @@
-DROP SCHEMA IF EXISTS public CASCADE;
-CREATE SCHEMA public AUTHORIZATION "[% admin_role %]";
-REVOKE ALL ON SCHEMA public FROM PUBLIC;
-GRANT USAGE ON SCHEMA public TO "[% rw_role %]";
-GRANT USAGE ON SCHEMA public TO "[% ro_role %]";
-
-DROP SCHEMA IF EXISTS audit CASCADE;
-CREATE SCHEMA audit AUTHORIZATION "[% admin_role %]";
-REVOKE ALL ON SCHEMA audit FROM PUBLIC;
-GRANT USAGE ON SCHEMA audit TO "[% rw_role %]";
-GRANT USAGE ON SCHEMA audit TO "[% ro_role %]";
View
5 ddl/templates/test_roles.sql
@@ -1,5 +0,0 @@
-CREATE ROLE "[% test_admin_role %]" WITH NOLOGIN NOINHERIT;
-CREATE ROLE "[% test_role %]" WITH ENCRYPTED PASSWORD '[% test_passwd %]' LOGIN INHERIT IN ROLE "[% rw_role %]";
-
-GRANT "[% test_admin_role %]" TO "[% test_role %]";
-GRANT "[% admin_role %]" TO "[% test_admin_role %]";
View
428 ddl/templates/versions/1/audit-up.sql
@@ -1,428 +0,0 @@
-CREATE TABLE audit.roles (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-name text
-);
-GRANT SELECT ON audit.roles TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.roles TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_roles_audit()
-RETURNS TRIGGER AS $roles_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.roles SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.roles SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.roles SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$roles_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER roles_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.roles
- FOR EACH ROW EXECUTE PROCEDURE public.process_roles_audit();
-CREATE TABLE audit.qc_seq_project_wells (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-qc_seq_project_id text,
-plate_name text,
-well_name text
-);
-GRANT SELECT ON audit.qc_seq_project_wells TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_seq_project_wells TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_seq_project_wells_audit()
-RETURNS TRIGGER AS $qc_seq_project_wells_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_seq_project_wells SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_seq_project_wells SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_seq_project_wells SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_seq_project_wells_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_seq_project_wells_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_seq_project_wells
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_seq_project_wells_audit();
-CREATE TABLE audit.schema_versions (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-version integer,
-deployed_at timestamp without time zone
-);
-GRANT SELECT ON audit.schema_versions TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.schema_versions TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_schema_versions_audit()
-RETURNS TRIGGER AS $schema_versions_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.schema_versions SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.schema_versions SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.schema_versions SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$schema_versions_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER schema_versions_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.schema_versions
- FOR EACH ROW EXECUTE PROCEDURE public.process_schema_versions_audit();
-CREATE TABLE audit.qc_alignments (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-qc_seq_read_id text,
-qc_eng_seq_id integer,
-primer_name text,
-query_start integer,
-query_end integer,
-query_strand integer,
-target_start integer,
-target_end integer,
-target_strand integer,
-score integer,
-pass boolean,
-features text,
-cigar text,
-op_str text
-);
-GRANT SELECT ON audit.qc_alignments TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_alignments TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_alignments_audit()
-RETURNS TRIGGER AS $qc_alignments_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_alignments SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_alignments SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_alignments SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_alignments_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_alignments_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_alignments
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_alignments_audit();
-CREATE TABLE audit.user_role (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-user_id integer,
-role_id integer
-);
-GRANT SELECT ON audit.user_role TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.user_role TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_user_role_audit()
-RETURNS TRIGGER AS $user_role_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.user_role SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.user_role SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.user_role SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$user_role_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER user_role_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.user_role
- FOR EACH ROW EXECUTE PROCEDURE public.process_user_role_audit();
-CREATE TABLE audit.qc_templates (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-name text,
-created_at timestamp without time zone
-);
-GRANT SELECT ON audit.qc_templates TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_templates TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_templates_audit()
-RETURNS TRIGGER AS $qc_templates_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_templates SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_templates SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_templates SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_templates_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_templates_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_templates
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_templates_audit();
-CREATE TABLE audit.qc_eng_seqs (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-method text,
-params text
-);
-GRANT SELECT ON audit.qc_eng_seqs TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_eng_seqs TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_eng_seqs_audit()
-RETURNS TRIGGER AS $qc_eng_seqs_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_eng_seqs SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_eng_seqs SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_eng_seqs SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_eng_seqs_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_eng_seqs_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_eng_seqs
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_eng_seqs_audit();
-CREATE TABLE audit.qc_alignment_regions (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-qc_alignment_id integer,
-name text,
-length integer,
-match_count integer,
-query_str text,
-target_str text,
-match_str text,
-pass boolean
-);
-GRANT SELECT ON audit.qc_alignment_regions TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_alignment_regions TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_alignment_regions_audit()
-RETURNS TRIGGER AS $qc_alignment_regions_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_alignment_regions SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_alignment_regions SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_alignment_regions SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_alignment_regions_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_alignment_regions_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_alignment_regions
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_alignment_regions_audit();
-CREATE TABLE audit.users (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-name text,
-password text
-);
-GRANT SELECT ON audit.users TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.users TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_users_audit()
-RETURNS TRIGGER AS $users_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.users SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.users SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.users SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$users_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER users_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.users
- FOR EACH ROW EXECUTE PROCEDURE public.process_users_audit();
-CREATE TABLE audit.qc_test_results (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-qc_run_id character(36),
-qc_eng_seq_id integer,
-qc_seq_project_well_id integer,
-score integer,
-pass boolean
-);
-GRANT SELECT ON audit.qc_test_results TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_test_results TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_test_results_audit()
-RETURNS TRIGGER AS $qc_test_results_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_test_results SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_test_results SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_test_results SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_test_results_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_test_results_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_test_results
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_test_results_audit();
-CREATE TABLE audit.qc_seq_reads (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text,
-description text,
-qc_seq_project_well_id integer,
-primer_name text,
-seq text,
-length integer
-);
-GRANT SELECT ON audit.qc_seq_reads TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_seq_reads TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_seq_reads_audit()
-RETURNS TRIGGER AS $qc_seq_reads_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_seq_reads SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_seq_reads SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_seq_reads SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_seq_reads_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_seq_reads_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_seq_reads
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_seq_reads_audit();
-CREATE TABLE audit.qc_runs (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id character(36),
-created_at timestamp without time zone,
-created_by_id integer,
-profile text,
-qc_template_id integer,
-software_version text,
-upload_complete boolean
-);
-GRANT SELECT ON audit.qc_runs TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_runs TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_runs_audit()
-RETURNS TRIGGER AS $qc_runs_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_runs SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_runs SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_runs SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_runs_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_runs_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_runs
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_runs_audit();
-CREATE TABLE audit.qc_template_wells (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-qc_template_id integer,
-name text,
-qc_eng_seq_id integer
-);
-GRANT SELECT ON audit.qc_template_wells TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_template_wells TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_template_wells_audit()
-RETURNS TRIGGER AS $qc_template_wells_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_template_wells SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_template_wells SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_template_wells SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_template_wells_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_template_wells_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_template_wells
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_template_wells_audit();
-CREATE TABLE audit.qc_run_seq_project (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-qc_run_id character(36),
-qc_seq_project_id text
-);
-GRANT SELECT ON audit.qc_run_seq_project TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_run_seq_project TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_run_seq_project_audit()
-RETURNS TRIGGER AS $qc_run_seq_project_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_run_seq_project SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_run_seq_project SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_run_seq_project SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_run_seq_project_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_run_seq_project_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_run_seq_project
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_run_seq_project_audit();
-CREATE TABLE audit.qc_seq_projects (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.qc_seq_projects TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_seq_projects TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_seq_projects_audit()
-RETURNS TRIGGER AS $qc_seq_projects_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_seq_projects SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_seq_projects SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_seq_projects SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_seq_projects_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_seq_projects_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_seq_projects
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_seq_projects_audit();
View
6 ddl/templates/versions/1/fixtures.sql
@@ -1,6 +0,0 @@
-
-INSERT INTO schema_versions (version) VALUES (1);
-
-INSERT INTO roles (name)
-VALUES ('admin'),('edit'),('read');
-
View
173 ddl/templates/versions/1/up.sql
@@ -1,173 +0,0 @@
---
--- Initial schema version. Contains tables to store users, roles and qc data
---
-
---
--- Schema metadata
---
-CREATE TABLE schema_versions (
- version INTEGER NOT NULL,
- deployed_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- PRIMARY KEY (version, deployed_at)
-);
-GRANT SELECT ON schema_versions TO "[% ro_role %]", "[% rw_role %]";
-
---
--- Users and roles
---
-CREATE TABLE users (
- id SERIAL PRIMARY KEY,
- name TEXT NOT NULL UNIQUE CHECK (name <> ''),
- password TEXT
-);
-GRANT SELECT ON users TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON users TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE users_id_seq TO "[% rw_role %]";
-
-CREATE TABLE roles (
- id SERIAL PRIMARY KEY,
- name TEXT NOT NULL UNIQUE CHECK (name <> '')
-);
-GRANT SELECT ON roles TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON roles TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE roles_id_seq TO "[% rw_role %]";
-
-CREATE TABLE user_role (
- user_id INTEGER NOT NULL REFERENCES users(id),
- role_id INTEGER NOT NULL REFERENCES roles(id),
- PRIMARY KEY (user_id, role_id)
-);
-GRANT SELECT ON user_role TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON user_role TO "[% rw_role %]";
-
---
--- Data for sequencing QC
---
-CREATE TABLE qc_eng_seqs (
- id SERIAL PRIMARY KEY,
- method TEXT NOT NULL,
- params TEXT NOT NULL,
- UNIQUE ( method, params )
-);
-GRANT SELECT ON qc_eng_seqs TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_eng_seqs TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE qc_eng_seqs_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_templates (
- id SERIAL PRIMARY KEY,
- name TEXT NOT NULL,
- created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- UNIQUE (name, created_at)
-);
-GRANT SELECT ON qc_templates TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_templates TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE qc_templates_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_template_wells (
- id SERIAL PRIMARY KEY,
- qc_template_id INTEGER NOT NULL REFERENCES qc_templates(id),
- name TEXT NOT NULL CHECK (name ~ '^[A-O](0[1-9]|1[0-9]|2[0-4])$'),
- qc_eng_seq_id INTEGER NOT NULL REFERENCES qc_eng_seqs(id),
- UNIQUE (qc_template_id, name)
-);
-GRANT SELECT ON qc_template_wells TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_template_wells TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE qc_template_wells_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_runs (
- id CHAR(36) PRIMARY KEY,
- created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
- created_by_id INTEGER NOT NULL REFERENCES users(id),
- profile TEXT NOT NULL,
- qc_template_id INTEGER NOT NULL REFERENCES qc_templates(id),
- software_version TEXT NOT NULL,
- upload_complete BOOLEAN NOT NULL DEFAULT FALSE
-);
-GRANT SELECT ON qc_runs TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_runs TO "[% rw_role %]";
-
-CREATE TABLE qc_seq_projects (
- id TEXT PRIMARY KEY
-);
-GRANT SELECT ON qc_seq_projects TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_seq_projects TO "[% rw_role %]";
-
-CREATE TABLE qc_seq_project_wells (
- id SERIAL PRIMARY KEY,
- qc_seq_project_id TEXT NOT NULL REFERENCES qc_seq_projects(id),
- plate_name TEXT NOT NULL,
- well_name TEXT NOT NULL,
- UNIQUE(qc_seq_project_id,plate_name,well_name)
-);
-GRANT SELECT ON qc_seq_project_wells TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_seq_project_wells TO "[% rw_role %]";
-GRANT USAGE ON qc_seq_project_wells_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_seq_reads (
- id TEXT PRIMARY KEY,
- description TEXT NOT NULL DEFAULT '',
- qc_seq_project_well_id INTEGER NOT NULL REFERENCES qc_seq_project_wells(id),
- primer_name TEXT NOT NULL,
- seq TEXT NOT NULL,
- length INTEGER NOT NULL
-);
-GRANT SELECT ON qc_seq_reads TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_seq_reads TO "[% rw_role %]";
-
-CREATE INDEX ON qc_seq_reads(qc_seq_project_well_id);
-
-CREATE TABLE qc_run_seq_project (
- qc_run_id CHAR(36) NOT NULL REFERENCES qc_runs(id),
- qc_seq_project_id TEXT NOT NULL REFERENCES qc_seq_projects(id),
- PRIMARY KEY(qc_run_id, qc_seq_project_id)
-);
-GRANT SELECT ON qc_run_seq_project TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_run_seq_project TO "[% rw_role %]";
-
-CREATE TABLE qc_test_results (
- id SERIAL PRIMARY KEY,
- qc_run_id CHAR(36) NOT NULL REFERENCES qc_runs(id),
- qc_eng_seq_id INTEGER NOT NULL REFERENCES qc_eng_seqs(id),
- qc_seq_project_well_id INTEGER NOT NULL REFERENCES qc_seq_project_wells(id),
- score INTEGER NOT NULL DEFAULT 0,
- pass BOOLEAN NOT NULL DEFAULT FALSE,
- UNIQUE(qc_run_id, qc_eng_seq_id, qc_seq_project_well_id)
-);
-GRANT SELECT ON qc_test_results TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_test_results TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE qc_test_results_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_alignments (
- id SERIAL PRIMARY KEY,
- qc_seq_read_id TEXT NOT NULL REFERENCES qc_seq_reads(id),
- qc_eng_seq_id INTEGER NOT NULL REFERENCES qc_eng_seqs(id),
- primer_name TEXT NOT NULL,
- query_start INTEGER NOT NULL,
- query_end INTEGER NOT NULL,
- query_strand INTEGER NOT NULL CHECK (query_strand IN (1, -1)),
- target_start INTEGER NOT NULL,
- target_end INTEGER NOT NULL,
- target_strand INTEGER NOT NULL CHECK (target_strand IN (1, -1)),
- score INTEGER NOT NULL,
- pass BOOLEAN NOT NULL DEFAULT FALSE,
- features TEXT NOT NULL,
- cigar TEXT NOT NULL,
- op_str TEXT NOT NULL
-);
-GRANT SELECT ON qc_alignments TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_alignments TO "[% rw_role %]";
-GRANT USAGE ON SEQUENCE qc_alignments_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_alignment_regions (
- qc_alignment_id INTEGER NOT NULL REFERENCES qc_alignments(id),
- name TEXT NOT NULL,
- length INTEGER NOT NULL,
- match_count INTEGER NOT NULL,
- query_str TEXT NOT NULL,
- target_str TEXT NOT NULL,
- match_str TEXT NOT NULL,
- pass BOOLEAN NOT NULL DEFAULT FALSE,
- PRIMARY KEY(qc_alignment_id, name)
-);
-GRANT SELECT ON qc_alignment_regions TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_alignment_regions TO "[% rw_role %]";
View
31 ddl/templates/versions/2/audit-up.sql
@@ -1,31 +0,0 @@
-ALTER TABLE audit.qc_seq_project_wells DROP COLUMN qc_seq_project_id;
-
-CREATE TABLE audit.qc_seq_project_qc_seq_project_well (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-qc_seq_project_id text,
-qc_seq_project_well_id integer
-);
-GRANT SELECT ON audit.qc_seq_project_qc_seq_project_well TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.qc_seq_project_qc_seq_project_well TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_qc_seq_project_qc_seq_project_well_audit()
-RETURNS TRIGGER AS $qc_seq_project_qc_seq_project_well_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.qc_seq_project_qc_seq_project_well SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.qc_seq_project_qc_seq_project_well SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.qc_seq_project_qc_seq_project_well SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$qc_seq_project_qc_seq_project_well_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER qc_seq_project_qc_seq_project_well_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.qc_seq_project_qc_seq_project_well
- FOR EACH ROW EXECUTE PROCEDURE public.process_qc_seq_project_qc_seq_project_well_audit();
-
-ALTER TABLE audit.users
-ADD COLUMN active BOOLEAN;
View
1  ddl/templates/versions/2/fixtures.sql
@@ -1 +0,0 @@
-INSERT INTO schema_versions(version) VALUES (2);
View
1  ddl/templates/versions/2/roles.sql
@@ -1 +0,0 @@
-ALTER ROLE "[% admin_role %]" WITH CREATEROLE;
View
31 ddl/templates/versions/2/up.sql
@@ -1,31 +0,0 @@
-
-DROP TABLE qc_seq_project_wells CASCADE;
-
-CREATE TABLE qc_seq_project_wells (
- id SERIAL PRIMARY KEY,
- plate_name TEXT NOT NULL,
- well_name TEXT NOT NULL,
- UNIQUE (plate_name, well_name)
-);
-GRANT SELECT ON qc_seq_project_wells TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_seq_project_wells TO "[% rw_role %]";
-GRANT USAGE ON qc_seq_project_wells_id_seq TO "[% rw_role %]";
-
-CREATE TABLE qc_seq_project_qc_seq_project_well (
- qc_seq_project_id TEXT NOT NULL REFERENCES qc_seq_projects(id),
- qc_seq_project_well_id INTEGER NOT NULL REFERENCES qc_seq_project_wells(id),
- PRIMARY KEY(qc_seq_project_id, qc_seq_project_well_id)
-);
-GRANT SELECT ON qc_seq_project_qc_seq_project_well TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON qc_seq_project_qc_seq_project_well TO "[% rw_role %]";
-
-ALTER TABLE qc_test_results
-ADD CONSTRAINT "qc_test_results_qc_seq_project_well_id_fkey"
-FOREIGN KEY (qc_seq_project_well_id) REFERENCES qc_seq_project_wells(id);
-
-ALTER TABLE qc_seq_reads
-ADD CONSTRAINT "qc_seq_reads_qc_seq_project_well_id_fkey"
-FOREIGN KEY (qc_seq_project_well_id) REFERENCES qc_seq_project_wells(id);
-
-ALTER TABLE users
-ADD COLUMN active BOOLEAN NOT NULL DEFAULT TRUE;
View
409 ddl/templates/versions/3/audit-up.sql
@@ -1,409 +0,0 @@
-CREATE TABLE audit.bac_clones (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-name text,
-bac_library_id text
-);
-GRANT SELECT ON audit.bac_clones TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.bac_clones TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_bac_clones_audit()
-RETURNS TRIGGER AS $bac_clones_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.bac_clones SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.bac_clones SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.bac_clones SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$bac_clones_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER bac_clones_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.bac_clones
- FOR EACH ROW EXECUTE PROCEDURE public.process_bac_clones_audit();
-CREATE TABLE audit.design_oligo_types (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.design_oligo_types TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.design_oligo_types TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_design_oligo_types_audit()
-RETURNS TRIGGER AS $design_oligo_types_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.design_oligo_types SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.design_oligo_types SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.design_oligo_types SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$design_oligo_types_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER design_oligo_types_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.design_oligo_types
- FOR EACH ROW EXECUTE PROCEDURE public.process_design_oligo_types_audit();
-CREATE TABLE audit.design_types (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.design_types TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.design_types TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_design_types_audit()
-RETURNS TRIGGER AS $design_types_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.design_types SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.design_types SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.design_types SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$design_types_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER design_types_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.design_types
- FOR EACH ROW EXECUTE PROCEDURE public.process_design_types_audit();
-CREATE TABLE audit.chromosomes (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.chromosomes TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.chromosomes TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_chromosomes_audit()
-RETURNS TRIGGER AS $chromosomes_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.chromosomes SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.chromosomes SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.chromosomes SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$chromosomes_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER chromosomes_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.chromosomes
- FOR EACH ROW EXECUTE PROCEDURE public.process_chromosomes_audit();
-CREATE TABLE audit.bac_clone_loci (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-bac_clone_id integer,
-assembly_id text,
-chr_id text,
-chr_start integer,
-chr_end integer
-);
-GRANT SELECT ON audit.bac_clone_loci TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.bac_clone_loci TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_bac_clone_loci_audit()
-RETURNS TRIGGER AS $bac_clone_loci_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.bac_clone_loci SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.bac_clone_loci SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.bac_clone_loci SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$bac_clone_loci_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER bac_clone_loci_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.bac_clone_loci
- FOR EACH ROW EXECUTE PROCEDURE public.process_bac_clone_loci_audit();
-CREATE TABLE audit.gene_design (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-gene_id text,
-design_id integer,
-created_by integer,
-created_at timestamp without time zone
-);
-GRANT SELECT ON audit.gene_design TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.gene_design TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_gene_design_audit()
-RETURNS TRIGGER AS $gene_design_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.gene_design SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.gene_design SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.gene_design SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$gene_design_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER gene_design_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.gene_design
- FOR EACH ROW EXECUTE PROCEDURE public.process_gene_design_audit();
-CREATE TABLE audit.design_oligos (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-design_id integer,
-design_oligo_type_id text,
-seq text
-);
-GRANT SELECT ON audit.design_oligos TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.design_oligos TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_design_oligos_audit()
-RETURNS TRIGGER AS $design_oligos_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.design_oligos SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.design_oligos SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.design_oligos SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$design_oligos_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER design_oligos_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.design_oligos
- FOR EACH ROW EXECUTE PROCEDURE public.process_design_oligos_audit();
-CREATE TABLE audit.bac_libraries (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.bac_libraries TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.bac_libraries TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_bac_libraries_audit()
-RETURNS TRIGGER AS $bac_libraries_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.bac_libraries SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.bac_libraries SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.bac_libraries SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$bac_libraries_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER bac_libraries_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.bac_libraries
- FOR EACH ROW EXECUTE PROCEDURE public.process_bac_libraries_audit();
-CREATE TABLE audit.design_oligo_loci (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-design_oligo_id integer,
-assembly_id text,
-chr_id text,
-chr_start integer,
-chr_end integer,
-chr_strand integer
-);
-GRANT SELECT ON audit.design_oligo_loci TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.design_oligo_loci TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_design_oligo_loci_audit()
-RETURNS TRIGGER AS $design_oligo_loci_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.design_oligo_loci SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.design_oligo_loci SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.design_oligo_loci SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$design_oligo_loci_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER design_oligo_loci_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.design_oligo_loci
- FOR EACH ROW EXECUTE PROCEDURE public.process_design_oligo_loci_audit();
-CREATE TABLE audit.designs (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-name text,
-created_by integer,
-created_at timestamp without time zone,
-design_type_id text,
-phase integer,
-validated_by_annotation text,
-target_transcript text
-);
-GRANT SELECT ON audit.designs TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.designs TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_designs_audit()
-RETURNS TRIGGER AS $designs_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.designs SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.designs SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.designs SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$designs_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER designs_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.designs
- FOR EACH ROW EXECUTE PROCEDURE public.process_designs_audit();
-CREATE TABLE audit.genotyping_primer_types (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.genotyping_primer_types TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.genotyping_primer_types TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_genotyping_primer_types_audit()
-RETURNS TRIGGER AS $genotyping_primer_types_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.genotyping_primer_types SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.genotyping_primer_types SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.genotyping_primer_types SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$genotyping_primer_types_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER genotyping_primer_types_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.genotyping_primer_types
- FOR EACH ROW EXECUTE PROCEDURE public.process_genotyping_primer_types_audit();
-CREATE TABLE audit.design_comment_categories (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-name text
-);
-GRANT SELECT ON audit.design_comment_categories TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.design_comment_categories TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_design_comment_categories_audit()
-RETURNS TRIGGER AS $design_comment_categories_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.design_comment_categories SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.design_comment_categories SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.design_comment_categories SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$design_comment_categories_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER design_comment_categories_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.design_comment_categories
- FOR EACH ROW EXECUTE PROCEDURE public.process_design_comment_categories_audit();
-CREATE TABLE audit.design_comments (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-design_comment_category_id integer,
-design_id integer,
-comment_text text,
-is_public boolean,
-created_by integer,
-created_at timestamp without time zone
-);
-GRANT SELECT ON audit.design_comments TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.design_comments TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_design_comments_audit()
-RETURNS TRIGGER AS $design_comments_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.design_comments SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.design_comments SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.design_comments SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$design_comments_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER design_comments_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.design_comments
- FOR EACH ROW EXECUTE PROCEDURE public.process_design_comments_audit();
-CREATE TABLE audit.assemblies (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id text
-);
-GRANT SELECT ON audit.assemblies TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.assemblies TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_assemblies_audit()
-RETURNS TRIGGER AS $assemblies_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.assemblies SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.assemblies SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.assemblies SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$assemblies_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER assemblies_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.assemblies
- FOR EACH ROW EXECUTE PROCEDURE public.process_assemblies_audit();
-CREATE TABLE audit.genotyping_primers (
-audit_op CHAR(1) NOT NULL CHECK (audit_op IN ('D','I','U')),
-audit_user TEXT NOT NULL,
-audit_stamp TIMESTAMP NOT NULL,
-audit_txid INTEGER NOT NULL,
-id integer,
-genotyping_primer_type_id text,
-design_id integer,
-seq text
-);
-GRANT SELECT ON audit.genotyping_primers TO "[% ro_role %]";
-GRANT SELECT,INSERT ON audit.genotyping_primers TO "[% rw_role %]";
-CREATE OR REPLACE FUNCTION public.process_genotyping_primers_audit()
-RETURNS TRIGGER AS $genotyping_primers_audit$
- BEGIN
- IF (TG_OP = 'DELETE') THEN
- INSERT INTO audit.genotyping_primers SELECT 'D', user, now(), txid_current(), OLD.*;
- ELSIF (TG_OP = 'UPDATE') THEN
- INSERT INTO audit.genotyping_primers SELECT 'U', user, now(), txid_current(), NEW.*;
- ELSIF (TG_OP = 'INSERT') THEN
- INSERT INTO audit.genotyping_primers SELECT 'I', user, now(), txid_current(), NEW.*;
- END IF;
- RETURN NULL;
- END;
-$genotyping_primers_audit$ LANGUAGE plpgsql;
-CREATE TRIGGER genotyping_primers_audit
-AFTER INSERT OR UPDATE OR DELETE ON public.genotyping_primers
- FOR EACH ROW EXECUTE PROCEDURE public.process_genotyping_primers_audit();
View
39 ddl/templates/versions/3/fixtures.sql
@@ -1,39 +0,0 @@
-INSERT INTO schema_versions(version) VALUES (3);
-
-INSERT INTO assemblies(id)
-VALUES ('NCBIM34'), ('NCBIM36'), ('NCBIM37');
-
-INSERT INTO chromosomes (id)
-VALUES ('1'), ('2'), ('3'), ('4'), ('5'), ('6'), ('7'), ('8'), ('9'),
- ('10'), ('11'), ('12'), ('13'), ('14'), ('15'), ('16'),
- ('17'), ('18'), ('19'), ('X'), ('Y');
-
-INSERT INTO bac_libraries (id) VALUES ('129'), ('black6');
-
-INSERT INTO design_types(id)
-VALUES ('conditional'), ('deletion'), ('insertion'), ('artificial-intron'), ('intron-replacement'), ('cre-bac');
-
-INSERT INTO design_oligo_types(id)
-VALUES ('G5'), ('U5'), ('U3'), ('D5'), ('D3'), ('G3');
-
-INSERT INTO design_comment_categories(name)
- VALUES ('Alternative variant not targeted'),
- ('NMD rescue'),
- ('Possible reinitiation'),
- ('Non protein coding locus'),
- ('Conserved elements'),
- ('Recovery design'),
- ('No NMD'),
- ('Other'),
- ('No BACs available'),
- ('Warning!'),
- ('Upstream domain unaffected'),
- ('Overlapping locus');
-
-INSERT INTO genotyping_primer_types(id)
-VALUES ('GF1'), ('GF2'), ('GF3'), ('GF4'),
- ('GR1'), ('GR2'), ('GR3'), ('GR4'),
- ('LF1'), ('LF2'), ('LF3'),
- ('LR1'), ('LR2'), ('LR3'),
- ('PNFLR1'), ('PNFLR2'), ('PNFLR3'),
- ('EX3'), ('EX32'), ('EX5'), ('EX52');
View
154 ddl/templates/versions/3/up.sql
@@ -1,154 +0,0 @@
---
--- Constrained vocabulary for assemblies and chromosomes
---
-CREATE TABLE assemblies (
- id TEXT PRIMARY KEY
-);
-GRANT SELECT ON assemblies TO "[% ro_role %]";
-GRANT SELECT, INSERT, UPDATE, DELETE ON assemblies TO "[% rw_role %]";
-
-CREATE TABLE chromosomes (
- id TEXT PRIMARY KE