File: 12_dbmigrate.sql

package info (click to toggle)
kraft 0.45-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,732 kB
  • sloc: cpp: 23,458; sql: 1,171; python: 623; xml: 105; sh: 3; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 449 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
CREATE TABLE numberCycles (
  id INTEGER PRIMARY KEY ASC autoincrement,      
  name VARCHAR(64) NOT NULL,
  lastIdentNumber  INT NOT NULL,                          
  identTemplate VARCHAR(64) NOT NULL  
);                              
CREATE UNIQUE INDEX numCycleIdx_12 ON numberCycles( name );

INSERT INTO numberCycles (name, lastIdentNumber, identTemplate) VALUES 
  ("default", (SELECT ifnull( 1+MAX(docID), 1 ) FROM document), '%i-%yyyy' );