Rename +migrate+ files so that it can easily be sorted.
authorgniibe <gniibe@fsij.org>
Fri, 31 Jul 2009 07:08:40 +0000 (16:08 +0900)
committergniibe <gniibe@fsij.org>
Fri, 31 Jul 2009 07:08:40 +0000 (16:08 +0900)
+migrate+/20090731_gc_table.sql [new file with mode: 0644]
+migrate+/20090731_membership.sql [new file with mode: 0644]
+migrate+/gc_table_20090731.sql [deleted file]
+migrate+/membership_20090731.sql [deleted file]

diff --git a/+migrate+/20090731_gc_table.sql b/+migrate+/20090731_gc_table.sql
new file mode 100644 (file)
index 0000000..b11c944
--- /dev/null
@@ -0,0 +1,3 @@
+drop table "membership_member_bak";
+drop table "meeting_attendance_registration_bak";
+drop table "django_session";
diff --git a/+migrate+/20090731_membership.sql b/+migrate+/20090731_membership.sql
new file mode 100644 (file)
index 0000000..0957c6a
--- /dev/null
@@ -0,0 +1,79 @@
+#  In the class Member,
+#  
+#  -    member_type = models.ForeignKey(MemberType)
+#  +    member_type = models.CharField(max_length=1, choices=MEMBER_TYPE)
+#  
+#  In the class Member, same changes as class Member.
+#  
+#  And the class MemberType will not be used any more.
+#  # member_type
+#  # 1: member
+#  # 2: student member
+#  # 3: associate member (corporate member)
+#  class MemberType(models.Model):
+#      name = models.CharField(max_length=10)
+#      def __unicode__(self):
+#          return self.name
+#  """
+#  
+#  
+alter table "membership_member" rename to "membership_member20090730";
+create table "membership_member" (
+    "id" integer NOT NULL PRIMARY KEY,
+    "user_id" integer NULL UNIQUE REFERENCES "auth_user" ("id"),
+    "member_id" varchar(10) NOT NULL,
+    "member_type" varchar(1) NOT NULL,
+    "name_in_alphabet" varchar(50) NOT NULL,
+    "date_joined" date NULL,
+    "date_quit" date NULL,
+    "advance_payment" integer NOT NULL
+);
+insert into "membership_member" (
+       id, user_id, member_id, member_type, name_in_alphabet,
+        date_joined, date_quit, advance_payment)
+    select id, user_id, member_id, "M", name_in_alphabet, date_join, date_quit,
+       advance_payment from "membership_member20090730"
+    where member_type_id = 1;
+insert into "membership_member" (
+       id, user_id, member_id, member_type, name_in_alphabet,
+       date_joined, date_quit, advance_payment)
+    select id, user_id, member_id, "S", name_in_alphabet, date_join, date_quit,
+       advance_payment from "membership_member20090730"
+    where member_type_id = 2;
+insert into "membership_member" (
+       id, user_id, member_id, member_type, name_in_alphabet,
+       date_joined, date_quit, advance_payment)
+    select id, user_id, member_id, "A", name_in_alphabet, date_join, date_quit,
+       advance_payment from "membership_member20090730"
+    where member_type_id = 3;
+
+alter table "membership_memberpayment" rename to "membership_memberpayment20090730";
+create table "membership_memberpayment" (
+    "id" integer NOT NULL PRIMARY KEY,
+    "member_id" integer NOT NULL REFERENCES "membership_member" ("id"),
+    "date" date NOT NULL,
+    "fee_id" integer NOT NULL,
+    "member_type" varchar(1) NOT NULL,
+    "contribution" integer NOT NULL,
+    "t_i_id" integer NULL UNIQUE
+);
+insert into "membership_memberpayment" (id, member_id, date,
+       fee_id, member_type, contribution, t_i_id)
+    select id, member_id, date, fee_id, "M",
+       contribution, t_i_id from "membership_memberpayment20090730"
+    where member_type_id = 1;
+insert into "membership_memberpayment" (id, member_id, date,
+       fee_id, member_type, contribution, t_i_id)
+    select id, member_id, date, fee_id, "S",
+       contribution, t_i_id from "membership_memberpayment20090730"
+    where member_type_id = 2;
+insert into "membership_memberpayment" (id, member_id, date,
+       fee_id, member_type, contribution, t_i_id)
+    select id, member_id, date, fee_id, "A",
+       contribution, t_i_id from "membership_memberpayment20090730"
+    where member_type_id = 3;
+
+drop table "membership_membertype";
+drop table "membership_memberpayment20090730"
+;
+drop table "membership_member20090730";
diff --git a/+migrate+/gc_table_20090731.sql b/+migrate+/gc_table_20090731.sql
deleted file mode 100644 (file)
index b11c944..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-drop table "membership_member_bak";
-drop table "meeting_attendance_registration_bak";
-drop table "django_session";
diff --git a/+migrate+/membership_20090731.sql b/+migrate+/membership_20090731.sql
deleted file mode 100644 (file)
index 0957c6a..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#  In the class Member,
-#  
-#  -    member_type = models.ForeignKey(MemberType)
-#  +    member_type = models.CharField(max_length=1, choices=MEMBER_TYPE)
-#  
-#  In the class Member, same changes as class Member.
-#  
-#  And the class MemberType will not be used any more.
-#  # member_type
-#  # 1: member
-#  # 2: student member
-#  # 3: associate member (corporate member)
-#  class MemberType(models.Model):
-#      name = models.CharField(max_length=10)
-#      def __unicode__(self):
-#          return self.name
-#  """
-#  
-#  
-alter table "membership_member" rename to "membership_member20090730";
-create table "membership_member" (
-    "id" integer NOT NULL PRIMARY KEY,
-    "user_id" integer NULL UNIQUE REFERENCES "auth_user" ("id"),
-    "member_id" varchar(10) NOT NULL,
-    "member_type" varchar(1) NOT NULL,
-    "name_in_alphabet" varchar(50) NOT NULL,
-    "date_joined" date NULL,
-    "date_quit" date NULL,
-    "advance_payment" integer NOT NULL
-);
-insert into "membership_member" (
-       id, user_id, member_id, member_type, name_in_alphabet,
-        date_joined, date_quit, advance_payment)
-    select id, user_id, member_id, "M", name_in_alphabet, date_join, date_quit,
-       advance_payment from "membership_member20090730"
-    where member_type_id = 1;
-insert into "membership_member" (
-       id, user_id, member_id, member_type, name_in_alphabet,
-       date_joined, date_quit, advance_payment)
-    select id, user_id, member_id, "S", name_in_alphabet, date_join, date_quit,
-       advance_payment from "membership_member20090730"
-    where member_type_id = 2;
-insert into "membership_member" (
-       id, user_id, member_id, member_type, name_in_alphabet,
-       date_joined, date_quit, advance_payment)
-    select id, user_id, member_id, "A", name_in_alphabet, date_join, date_quit,
-       advance_payment from "membership_member20090730"
-    where member_type_id = 3;
-
-alter table "membership_memberpayment" rename to "membership_memberpayment20090730";
-create table "membership_memberpayment" (
-    "id" integer NOT NULL PRIMARY KEY,
-    "member_id" integer NOT NULL REFERENCES "membership_member" ("id"),
-    "date" date NOT NULL,
-    "fee_id" integer NOT NULL,
-    "member_type" varchar(1) NOT NULL,
-    "contribution" integer NOT NULL,
-    "t_i_id" integer NULL UNIQUE
-);
-insert into "membership_memberpayment" (id, member_id, date,
-       fee_id, member_type, contribution, t_i_id)
-    select id, member_id, date, fee_id, "M",
-       contribution, t_i_id from "membership_memberpayment20090730"
-    where member_type_id = 1;
-insert into "membership_memberpayment" (id, member_id, date,
-       fee_id, member_type, contribution, t_i_id)
-    select id, member_id, date, fee_id, "S",
-       contribution, t_i_id from "membership_memberpayment20090730"
-    where member_type_id = 2;
-insert into "membership_memberpayment" (id, member_id, date,
-       fee_id, member_type, contribution, t_i_id)
-    select id, member_id, date, fee_id, "A",
-       contribution, t_i_id from "membership_memberpayment20090730"
-    where member_type_id = 3;
-
-drop table "membership_membertype";
-drop table "membership_memberpayment20090730"
-;
-drop table "membership_member20090730";