from django.db import models

'''
Datahub Models

@author: Anant Bhardwaj
@date: Mar 21, 2013
'''

class User(models.Model):
	id = models.AutoField(primary_key=True)
	email = models.CharField(max_length=100, unique = True)
	username = models.CharField(max_length=50, unique = True)
	name = models.CharField(max_length=200)
	password = models.CharField(max_length=50)
	active = models.BooleanField(default=False)
	def __unicode__(self):
		return self.name

	class Meta:
		db_table = "users"


class Database(models.Model):
	id = models.AutoField(primary_key=True)
	name = models.CharField(max_length=50, unique = True)
	owner = models.ForeignKey('User')
	timestamp = models.DateTimeField(auto_now=True)
	def __unicode__(self):
		return self.name

	class Meta:
		db_table = "databases"


class Table(models.Model):
	id = models.AutoField(primary_key=True)
	name = models.CharField(max_length=100)
	schema = models.TextField()
	version = models.IntegerField()
	database = models.ForeignKey('Database')
	timestamp = models.DateTimeField(auto_now=True)
	def __unicode__(self):
		return self.name

	class Meta:
		db_table = "tables"





@@ -489,643 +489,6 @@
 %22%0A%0A%0A
-class Database(models.Model):%0A%09id = models.AutoField(primary_key=True)%0A%09name = models.CharField(max_length=50, unique = True)%0A%09owner = models.ForeignKey('User')%0A%09timestamp = models.DateTimeField(auto_now=True)%0A%09def __unicode__(self):%0A%09%09return self.name%0A%0A%09class Meta:%0A%09%09db_table = %22databases%22%0A%0A%0Aclass Table(models.Model):%0A%09id = models.AutoField(primary_key=True)%0A%09name = models.CharField(max_length=100)%0A%09schema = models.TextField()%0A%09version = models.IntegerField()%0A%09database = models.ForeignKey('Database')%0A%09timestamp = models.DateTimeField(auto_now=True)%0A%09def __unicode__(self):%0A%09%09return self.name%0A%0A%09class Meta:%0A%09%09db_table = %22tables%22%0A%0A%0A
 %0A%0A

remove unnecessary models