Skip to content

Commit

Permalink
use django's migrations to manage datebase
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaohuanshu committed Sep 19, 2016
1 parent 4b2b90a commit a8a5e7e
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*.pyo
*.log
.idea
manage.py
manage.py
migrations
4 changes: 0 additions & 4 deletions checkin/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def __unicode__(self):
return "%d %d" % (self.id, self.lesson.id)

class Meta:
managed = False
db_table = 'Checkin'


Expand All @@ -41,7 +40,6 @@ def __unicode__(self):
return "%d %d" % (self.id, self.lesson.id)

class Meta:
managed = False
db_table = 'CheckinRecord'


Expand All @@ -57,7 +55,6 @@ class Ask(models.Model):
student = models.ManyToManyField('school.Student', through='Asktostudent',
through_fields=('ask', 'student'))
class Meta:
managed = False
db_table = 'Ask'


Expand All @@ -66,5 +63,4 @@ class Asktostudent(models.Model):
ask = models.ForeignKey(Ask, models.DO_NOTHING, db_column='askid', blank=True, null=True)

class Meta:
managed = False
db_table = 'AsktoStudent'
3 changes: 0 additions & 3 deletions course/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def __unicode__(self):
return u"%s" % (self.title)

class Meta:
managed = False
db_table = 'Course'


Expand Down Expand Up @@ -222,7 +221,6 @@ def __unicode__(self):
return "%d %s-%d-%d-%d-%d" % (self.id, self.term, self.year, self.week, self.day, self.time)

class Meta:
managed = False
db_table = 'Lesson'


Expand All @@ -232,5 +230,4 @@ class Studentcourse(models.Model):
related_name='courses')

class Meta:
managed = False
db_table = 'StudentCourse'
2 changes: 0 additions & 2 deletions rbac/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class Resourcejurisdiction(models.Model):
related_name="children")

class Meta:
managed = False
db_table = 'ResourceJurisdiction'


Expand All @@ -20,5 +19,4 @@ class Roletoresourcejurisdiction(models.Model):
db_column='resourcejurisdictionid', blank=True, null=True)

class Meta:
managed = False
db_table = 'RoletoResourceJurisdiction'
12 changes: 0 additions & 12 deletions school/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def teachernumber(self):
return self.teacher_set.count()

class Meta:
managed = False
db_table = 'Administration'


Expand All @@ -30,7 +29,6 @@ def __unicode__(self):
return u"%s" % (self.name)

class Meta:
managed = False
db_table = 'Class'


Expand All @@ -40,7 +38,6 @@ class Classtime(models.Model):
endtime = models.TimeField(blank=True, null=True)

class Meta:
managed = False
db_table = 'ClassTime'


Expand All @@ -52,7 +49,6 @@ def __unicode__(self):
return u"%s" % (self.location)

class Meta:
managed = False
db_table = 'Classroom'


Expand All @@ -72,7 +68,6 @@ def __unicode__(self):
return u"%s" % (self.name)

class Meta:
managed = False
db_table = 'Department'


Expand All @@ -92,7 +87,6 @@ def classamount(self):
return self.class_set.count()

class Meta:
managed = False
db_table = 'Major'


Expand All @@ -107,7 +101,6 @@ def __unicode__(self):
return u"%s" % (self.description)

class Meta:
managed = False
db_table = 'SchoolTerm'


Expand All @@ -120,7 +113,6 @@ def __unicode__(self):
return "%d" % (self.seattype)

class Meta:
managed = False
db_table = 'Seat'


Expand All @@ -141,7 +133,6 @@ def __unicode__(self):
return u"%s" % (self.name)

class Meta:
managed = False
db_table = 'Student'


Expand All @@ -160,7 +151,6 @@ def __unicode__(self):
return u"%s" % (self.name)

class Meta:
managed = False
db_table = 'Teacher'


Expand All @@ -170,7 +160,6 @@ class Teachertoadministration(models.Model):
null=True)

class Meta:
managed = False
db_table = 'TeachertoAdministration'


Expand All @@ -179,7 +168,6 @@ class Teachertodepartment(models.Model):
department = models.ForeignKey(Department, models.DO_NOTHING, db_column='departmentid', blank=True, null=True)

class Meta:
managed = False
db_table = 'TeachertoDepartment'


Expand Down
5 changes: 1 addition & 4 deletions user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ def __unicode__(self):
return u"%s" % (self.name)

class Meta:
managed = False
db_table = 'Role'


Expand All @@ -25,7 +24,7 @@ class User(models.Model):
openid = models.CharField(max_length=28, blank=True, null=True)
password = models.CharField(max_length=32, blank=True, null=True)
sex = models.IntegerField(blank=True, null=True)
ip = models.TextField(blank=True, null=True) # This field type is a guess.
ip = models.GenericIPAddressField(protocol='IPv4', blank=True, null=True)
registertime = models.DateTimeField(blank=True, null=True)
lastlogintime = models.DateTimeField(blank=True, null=True)
email = models.CharField(max_length=40, blank=True, null=True)
Expand All @@ -48,7 +47,6 @@ def __unicode__(self):
return u"%s" % (self.username)

class Meta:
managed = False
db_table = 'User'


Expand All @@ -57,5 +55,4 @@ class Usertorole(models.Model):
role = models.ForeignKey(Role, models.DO_NOTHING, db_column='roleid', blank=True, null=True)

class Meta:
managed = False
db_table = 'UsertoRole'
2 changes: 0 additions & 2 deletions wechat/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class Wechatkeyword(models.Model):
data = models.CharField(max_length=255, blank=True, null=True)

class Meta:
managed = False
db_table = 'WechatKeyword'


Expand All @@ -28,5 +27,4 @@ class Wechatuser(models.Model):
accuracy = models.FloatField(blank=True, null=True)

class Meta:
managed = False
db_table = 'WechatUser'

0 comments on commit a8a5e7e

Please sign in to comment.