소스 검색

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
 );

Loading…
취소
저장