Difference between revisions of "User:Alex Doll"

From SAGMILLING.COM
Jump to: navigation, search
(Created page with "==Alex's to-do lists== Stuff that Alex needs to no forget. ===Setting up a new project=== # Create a new database & dbuser. # Create a new folder in circuitmodels/. # Copy th...")
 
(Setting up a new project)
Line 8: Line 8:
 
# Tweak the configuration file to point to the new database.
 
# Tweak the configuration file to point to the new database.
 
# fill in the database structure, including default data.
 
# fill in the database structure, including default data.
  +
<syntaxhighlight lang="mysql"><pre>
<pre>
 
PREPARE populate FROM 'CREATE TABLE `sagmilli_?`.`?` SELECT * FROM `sagmilli_agd`.`?` ?;'
+
CREATE TABLE `labs` SELECT * FROM `sagmilli_agd`.`labs`;
  +
CREATE TABLE `mills_classes` SELECT * FROM `sagmilli_agd`.`mills_classes`;
SET @db = 'Example';
 
  +
CREATE TABLE `project` SELECT * FROM `sagmilli_agd`.`project` WHERE `id`=1;
SET @where='';
 
  +
CREATE TABLE `ai` SELECT * FROM `sagmilli_agd`.`ai` WHERE `ProjNum`=1;
SET @table= 'labs';
 
  +
CREATE TABLE `dwt` SELECT * FROM `sagmilli_agd`.`dwt` WHERE `ProjNum`=1;
EXECUTE populate USING @db, @table, @table, @where;
 
  +
CREATE TABLE `geotech` SELECT * FROM `sagmilli_agd`.`geotech` WHERE `ProjNum`=1;
SET @table= 'mills_classes';
 
  +
CREATE TABLE `litho` SELECT * FROM `sagmilli_agd`.`litho` WHERE `ProjNum`=1;
EXECUTE populate USING @db, @table, @table, @where;
 
  +
CREATE TABLE `pli` SELECT * FROM `sagmilli_agd`.`pli` WHERE `ProjNum`=1;
SET @table= 'project';
 
  +
CREATE TABLE `project__circuits` SELECT * FROM `sagmilli_agd`.`projects__circuits` WHERE `ProjNum`=1;
SET @where=' WHERE `id`=1';
 
  +
CREATE TABLE `spi` SELECT * FROM `sagmilli_agd`.`spi` WHERE `ProjNum`=1;
EXECUTE populate USING @db, @table, @table, @where;
 
  +
CREATE TABLE `ucs` SELECT * FROM `sagmilli_agd`.`ucs` WHERE `ProjNum`=1;
SET @table= 'ai';
 
SET @where=' WHERE `ProjNum`=1';
+
CREATE TABLE `wibm` SELECT * FROM `sagmilli_agd`.`wibm` WHERE `ProjNum`=1;
  +
CREATE TABLE `wirm` SELECT * FROM `sagmilli_agd`.`wirm` WHERE `ProjNum`=1;
EXECUTE populate USING @db, @table, @table, @where;
 
  +
CREATE TABLE `wic` SELECT * FROM `sagmilli_agd`.`wic` WHERE `ProjNum`=1;
SET @table= 'dwt';
 
  +
CREATE TABLE `mills` SELECT * FROM `sagmilli_agd`.`mills` WHERE `ProjNum`=0 OR `ProjNum`=1;
EXECUTE populate USING @db, @table, @table, @where;
 
  +
</pre></syntaxhighlight>
SET @table= 'geotech';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'litho';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'pli';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'project__circuits';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'spi';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'ucs';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'wibm';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'wirm';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'wic';
 
EXECUTE populate USING @db, @table, @table, @where;
 
SET @table= 'mills';
 
SET @where= 'WHERE `ProjNum`=0 OR `ProjNum`=1';
 
EXECUTE populate USING @db, @table, @table, @where;
 
 
DEALLOCATE PREPARE populate;
 
</pre>
 

Revision as of 02:10, 17 November 2012

Alex's to-do lists

Stuff that Alex needs to no forget.

Setting up a new project

  1. Create a new database & dbuser.
  2. Create a new folder in circuitmodels/.
  3. Copy the base PHP files into the new folder.
  4. Tweak the configuration file to point to the new database.
  5. fill in the database structure, including default data.

<syntaxhighlight lang="mysql">

CREATE TABLE `labs` SELECT * FROM `sagmilli_agd`.`labs`;
CREATE TABLE `mills_classes` SELECT * FROM `sagmilli_agd`.`mills_classes`;
CREATE TABLE `project` SELECT * FROM `sagmilli_agd`.`project` WHERE `id`=1;
CREATE TABLE `ai` SELECT * FROM `sagmilli_agd`.`ai` WHERE `ProjNum`=1;
CREATE TABLE `dwt` SELECT * FROM `sagmilli_agd`.`dwt` WHERE `ProjNum`=1;
CREATE TABLE `geotech` SELECT * FROM `sagmilli_agd`.`geotech` WHERE `ProjNum`=1;
CREATE TABLE `litho` SELECT * FROM `sagmilli_agd`.`litho` WHERE `ProjNum`=1;
CREATE TABLE `pli` SELECT * FROM `sagmilli_agd`.`pli` WHERE `ProjNum`=1;
CREATE TABLE `project__circuits` SELECT * FROM `sagmilli_agd`.`projects__circuits` WHERE `ProjNum`=1;
CREATE TABLE `spi` SELECT * FROM `sagmilli_agd`.`spi` WHERE `ProjNum`=1;
CREATE TABLE `ucs` SELECT * FROM `sagmilli_agd`.`ucs` WHERE `ProjNum`=1;
CREATE TABLE `wibm` SELECT * FROM `sagmilli_agd`.`wibm` WHERE `ProjNum`=1;
CREATE TABLE `wirm` SELECT * FROM `sagmilli_agd`.`wirm` WHERE `ProjNum`=1;
CREATE TABLE `wic` SELECT * FROM `sagmilli_agd`.`wic` WHERE `ProjNum`=1;
CREATE TABLE `mills` SELECT * FROM `sagmilli_agd`.`mills` WHERE `ProjNum`=0 OR `ProjNum`=1;

</syntaxhighlight>