Difference between revisions of "User:Alex Doll"

From SAGMILLING.COM
Jump to: navigation, search
(Setting up a new project)
(Setting up a new project)
Line 11: Line 11:
 
<syntaxhighlight lang="mysql">
 
<syntaxhighlight lang="mysql">
 
CREATE TABLE `labs` SELECT * FROM `sagmilli_agd`.`labs`;
 
CREATE TABLE `labs` SELECT * FROM `sagmilli_agd`.`labs`;
  +
ALTER TABLE `labs` ADD PRIMARY KEY ( `id` ) ;
  +
 
CREATE TABLE `mills_classes` SELECT * FROM `sagmilli_agd`.`mills_classes`;
 
CREATE TABLE `mills_classes` SELECT * FROM `sagmilli_agd`.`mills_classes`;
  +
ALTER TABLE `mills_classes` ADD PRIMARY KEY ( `id` ) ;
  +
 
CREATE TABLE `project` SELECT * FROM `sagmilli_agd`.`project` WHERE `id`=1;
 
CREATE TABLE `project` SELECT * FROM `sagmilli_agd`.`project` WHERE `id`=1;
  +
INSERT INTO `project` (`id`, `name`, `folder`) VALUES (0, '_Listing of default mills', 'bond') ;
ALTER TABLE `project` AUTO_INCREMENT=2 ;
 
  +
ALTER TABLE `project` ADD PRIMARY KEY ( `id` ) ;
  +
 
CREATE TABLE `ai` SELECT * FROM `sagmilli_agd`.`ai` WHERE `ProjNum`=1;
 
CREATE TABLE `ai` SELECT * FROM `sagmilli_agd`.`ai` WHERE `ProjNum`=1;
  +
ALTER TABLE `ai` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `ai` ADD INDEX `ProjNum` ( `ProjNum` , `Sample` ) ;
  +
 
CREATE TABLE `dwt` SELECT * FROM `sagmilli_agd`.`dwt` WHERE `ProjNum`=1;
 
CREATE TABLE `dwt` SELECT * FROM `sagmilli_agd`.`dwt` WHERE `ProjNum`=1;
  +
ALTER TABLE `dwt` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `dwt` ADD INDEX `ProjNum` ( `ProjNum` , `Sample` ) ;
  +
 
CREATE TABLE `geotech` SELECT * FROM `sagmilli_agd`.`geotech` WHERE `ProjNum`=1;
 
CREATE TABLE `geotech` SELECT * FROM `sagmilli_agd`.`geotech` WHERE `ProjNum`=1;
  +
ALTER TABLE `geotech` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `geotech` ADD INDEX `ProjNum` ( `ProjNum` ) ;
  +
 
CREATE TABLE `litho` SELECT * FROM `sagmilli_agd`.`litho` WHERE `ProjNum`=1;
 
CREATE TABLE `litho` SELECT * FROM `sagmilli_agd`.`litho` WHERE `ProjNum`=1;
  +
ALTER TABLE `litho` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `litho` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `pli` SELECT * FROM `sagmilli_agd`.`pli` WHERE `ProjNum`=1;
 
CREATE TABLE `pli` SELECT * FROM `sagmilli_agd`.`pli` WHERE `ProjNum`=1;
  +
ALTER TABLE `pli` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `pli` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `project__circuits` SELECT * FROM `sagmilli_agd`.`project__circuits` WHERE `ProjNum`=1;
 
CREATE TABLE `project__circuits` SELECT * FROM `sagmilli_agd`.`project__circuits` WHERE `ProjNum`=1;
  +
ALTER TABLE `project__circuits` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `project__circuits` ADD INDEX `ProjNum` ( `ProjNum` ) ;
  +
 
CREATE TABLE `spi` SELECT * FROM `sagmilli_agd`.`spi` WHERE `ProjNum`=1;
 
CREATE TABLE `spi` SELECT * FROM `sagmilli_agd`.`spi` WHERE `ProjNum`=1;
  +
ALTER TABLE `spi` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `spi` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `ucs` SELECT * FROM `sagmilli_agd`.`ucs` WHERE `ProjNum`=1;
 
CREATE TABLE `ucs` SELECT * FROM `sagmilli_agd`.`ucs` WHERE `ProjNum`=1;
  +
ALTER TABLE `ucs` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `ucs` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `wibm` SELECT * FROM `sagmilli_agd`.`wibm` WHERE `ProjNum`=1;
 
CREATE TABLE `wibm` SELECT * FROM `sagmilli_agd`.`wibm` WHERE `ProjNum`=1;
  +
ALTER TABLE `wibm` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `wibm` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `wirm` SELECT * FROM `sagmilli_agd`.`wirm` WHERE `ProjNum`=1;
 
CREATE TABLE `wirm` SELECT * FROM `sagmilli_agd`.`wirm` WHERE `ProjNum`=1;
  +
ALTER TABLE `wirm` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `wirm` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `wic` SELECT * FROM `sagmilli_agd`.`wic` WHERE `ProjNum`=1;
 
CREATE TABLE `wic` SELECT * FROM `sagmilli_agd`.`wic` WHERE `ProjNum`=1;
  +
ALTER TABLE `wic` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `wic` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;
  +
 
CREATE TABLE `mills` SELECT * FROM `sagmilli_agd`.`mills` WHERE `ProjNum`=0 OR `ProjNum`=1;
 
CREATE TABLE `mills` SELECT * FROM `sagmilli_agd`.`mills` WHERE `ProjNum`=0 OR `ProjNum`=1;
  +
ALTER TABLE `mills` ADD PRIMARY KEY ( `id` ) ;
  +
ALTER TABLE `mills` ADD INDEX `ProjNum` ( `ProjNum` ) ;
  +
 
</syntaxhighlight>
 
</syntaxhighlight>
 
</div>
 
</div>

Revision as of 20:51, 20 November 2012

Alex's to-do lists

Stuff that Alex needs to not 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`; ALTER TABLE `labs` ADD PRIMARY KEY ( `id` ) ;

CREATE TABLE `mills_classes` SELECT * FROM `sagmilli_agd`.`mills_classes`; ALTER TABLE `mills_classes` ADD PRIMARY KEY ( `id` ) ;

CREATE TABLE `project` SELECT * FROM `sagmilli_agd`.`project` WHERE `id`=1; INSERT INTO `project` (`id`, `name`, `folder`) VALUES (0, '_Listing of default mills', 'bond') ; ALTER TABLE `project` ADD PRIMARY KEY ( `id` ) ;

CREATE TABLE `ai` SELECT * FROM `sagmilli_agd`.`ai` WHERE `ProjNum`=1; ALTER TABLE `ai` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `ai` ADD INDEX `ProjNum` ( `ProjNum` , `Sample` ) ;

CREATE TABLE `dwt` SELECT * FROM `sagmilli_agd`.`dwt` WHERE `ProjNum`=1; ALTER TABLE `dwt` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `dwt` ADD INDEX `ProjNum` ( `ProjNum` , `Sample` ) ;

CREATE TABLE `geotech` SELECT * FROM `sagmilli_agd`.`geotech` WHERE `ProjNum`=1; ALTER TABLE `geotech` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `geotech` ADD INDEX `ProjNum` ( `ProjNum` ) ;

CREATE TABLE `litho` SELECT * FROM `sagmilli_agd`.`litho` WHERE `ProjNum`=1; ALTER TABLE `litho` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `litho` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `pli` SELECT * FROM `sagmilli_agd`.`pli` WHERE `ProjNum`=1; ALTER TABLE `pli` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `pli` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `project__circuits` SELECT * FROM `sagmilli_agd`.`project__circuits` WHERE `ProjNum`=1; ALTER TABLE `project__circuits` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `project__circuits` ADD INDEX `ProjNum` ( `ProjNum` ) ;

CREATE TABLE `spi` SELECT * FROM `sagmilli_agd`.`spi` WHERE `ProjNum`=1; ALTER TABLE `spi` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `spi` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `ucs` SELECT * FROM `sagmilli_agd`.`ucs` WHERE `ProjNum`=1; ALTER TABLE `ucs` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `ucs` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `wibm` SELECT * FROM `sagmilli_agd`.`wibm` WHERE `ProjNum`=1; ALTER TABLE `wibm` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `wibm` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `wirm` SELECT * FROM `sagmilli_agd`.`wirm` WHERE `ProjNum`=1; ALTER TABLE `wirm` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `wirm` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `wic` SELECT * FROM `sagmilli_agd`.`wic` WHERE `ProjNum`=1; ALTER TABLE `wic` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `wic` ADD INDEX `ProjNum` ( `ProjNum`,`Sample` ) ;

CREATE TABLE `mills` SELECT * FROM `sagmilli_agd`.`mills` WHERE `ProjNum`=0 OR `ProjNum`=1; ALTER TABLE `mills` ADD PRIMARY KEY ( `id` ) ; ALTER TABLE `mills` ADD INDEX `ProjNum` ( `ProjNum` ) ;

</syntaxhighlight>