github.com/slspeek/camlistore_namedsearch@v0.0.0-20140519202248-ed6f70f7721a/pkg/sorted/mysql/dbschema.go (about) 1 /* 2 Copyright 2011 The Camlistore Authors. 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 */ 16 17 package mysql 18 19 const requiredSchemaVersion = 21 20 21 func SchemaVersion() int { 22 return requiredSchemaVersion 23 } 24 25 // Note: using character set "binary", as any knowledge 26 // of character set encodings is handled by higher layers. 27 // At this layer we're just obeying the IndexStorage interface, 28 // which is purely about bytes. 29 func SQLCreateTables() []string { 30 return []string{ 31 `CREATE TABLE IF NOT EXISTS rows ( 32 k VARCHAR(255) NOT NULL PRIMARY KEY, 33 v VARCHAR(255)) 34 DEFAULT CHARACTER SET binary`, 35 36 `CREATE TABLE IF NOT EXISTS meta ( 37 metakey VARCHAR(255) NOT NULL PRIMARY KEY, 38 value VARCHAR(255) NOT NULL) 39 DEFAULT CHARACTER SET binary`, 40 } 41 }