Skip to content

Commit

Permalink
Added missing semicolons and 'IF NOT EXISTS'
Browse files Browse the repository at this point in the history
  • Loading branch information
christeredvartsen committed Jul 11, 2013
1 parent e602c14 commit ccb89f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions docs/installation/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ MySQL
KEY `imageId` (`imageId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci AUTO_INCREMENT=1 ;
CREATE TABLE `shorturl` (
CREATE TABLE IF NOT EXISTS `shorturl` (
`shortUrlId` char(7) COLLATE utf8_danish_ci NOT NULL,
`publicKey` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`imageIdentifier` char(32) COLLATE utf8_danish_ci NOT NULL,
Expand Down Expand Up @@ -223,38 +223,38 @@ SQLite
height INTEGER NOT NULL,
checksum TEXT NOT NULL,
UNIQUE (publicKey,imageIdentifier)
)
);
CREATE TABLE IF NOT EXISTS metadata (
id INTEGER PRIMARY KEY NOT NULL,
imageId KEY INTEGER NOT NULL,
tagName TEXT NOT NULL,
tagValue TEXT NOT NULL
)
);
CREATE TABLE IF NOT EXISTS shorturl (
shortUrlId TEXT PRIMARY KEY NOT NULL,
publicKey TEXT NOT NULL,
imageIdentifier TEXT NOT NULL,
extension TEXT,
query TEXT NOT NULL
)
);
CREATE INDEX shorturlparams ON shorturl (
publicKey,
imageIdentifier,
extension,
query
)
);
The following table is only needed if you plan on storing the actual images themselves in SQLite:

.. code-block:: sql
CREATE TABLE storage_images (
CREATE TABLE IF NOT EXISTS storage_images (
publicKey TEXT NOT NULL,
imageIdentifier TEXT NOT NULL,
data BLOB NOT NULL,
updated INTEGER NOT NULL,
PRIMARY KEY (publicKey,imageIdentifier)
)
);
2 changes: 1 addition & 1 deletion setup/doctrine.mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS `metadata` (
KEY `imageId` (`imageId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_danish_ci AUTO_INCREMENT=1 ;

CREATE TABLE `shorturl` (
CREATE TABLE IF NOT EXISTS `shorturl` (
`shortUrlId` char(7) COLLATE utf8_danish_ci NOT NULL,
`publicKey` varchar(255) COLLATE utf8_danish_ci NOT NULL,
`imageIdentifier` char(32) COLLATE utf8_danish_ci NOT NULL,
Expand Down

0 comments on commit ccb89f7

Please sign in to comment.