浏览代码

Convert all varchars to text

PostgreSQL works similarly with varchar and text columns. Rather than
limiting the amount of characters a column can hold simply use text
columns.

Because this sql is now PostgreSQL specific, there's no need to maintain
what was set in the mysql settings.
Shawn Sorichetti 11 年前
父节点
当前提交
1dc0a81479
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5
    5
      roles/mailserver/templates/mailserver.sql.j2

+ 5
- 5
roles/mailserver/templates/mailserver.sql.j2 查看文件

@@ -6,7 +6,7 @@ DROP TABLE IF EXISTS "virtual_domains";
6 6
 
7 7
 CREATE TABLE IF NOT EXISTS "virtual_domains" (
8 8
         "id" SERIAL,
9
-        "name" varchar(50) NOT NULL,
9
+        "name" TEXT NOT NULL,
10 10
         PRIMARY KEY ("id")
11 11
 );
12 12
 
@@ -15,8 +15,8 @@ CREATE UNIQUE INDEX name_idx ON virtual_domains (name);
15 15
 CREATE TABLE IF NOT EXISTS "virtual_users" (
16 16
         "id" SERIAL,
17 17
         "domain_id" int NOT NULL,
18
-        "password" varchar(106) NOT NULL,
19
-        "email" varchar(100) NOT NULL UNIQUE,
18
+        "password" TEXT NOT NULL,
19
+        "email" TEXT NOT NULL UNIQUE,
20 20
         PRIMARY KEY ("id"),
21 21
         FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
22 22
 );
@@ -27,8 +27,8 @@ CREATE UNIQUE INDEX email_idx ON virtual_users (email);
27 27
 CREATE TABLE IF NOT EXISTS "virtual_aliases" (
28 28
         "id" SERIAL,
29 29
         "domain_id" int NOT NULL,
30
-        "source" varchar(100) NOT NULL,
31
-        "destination" varchar(100) NOT NULL,
30
+        "source" TEXT NOT NULL,
31
+        "destination" TEXT NOT NULL,
32 32
         PRIMARY KEY ("id"),
33 33
         FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
34 34
 );

正在加载...
取消
保存