Commits

Julio Flores-Schwarzbeck committed cae0f71

Model standardization and added hidden files to preserve directory structure of the project

Comments (0)

Files changed (5)

 syntax: glob
 *.pyc
 errors/*
-sessions/*
-cache/*
-databases/*
+sessions/?.*
+sessions/??.*
+sessions/???.*
+cache/cache.*
+errors/?.*
+errors/??.*
+errors/???.*
+databases/*.sqlite
+databases/*.log
+databases/*.table
 .DS_Store

cache/.hidden

Empty file added.

databases/.hidden

Empty file added.
 
 # Control Migrations
 migrate = False
+fake_migrate = False # Read web2py docs for this
 
-db = DAL('sqlite://qastack.sqlite')
+db = DAL('sqlite://qastack.sqlite', migrate=migrate)
 #db = DAL('mysql://web2py:py2web@ds9.virtual:3306/qastack')
 
 # Import Authentication/Authorization
     Field('role_name', 'string', length=128, required=True),
     Field('role_min_score', 'integer', required=True),
     Field('color_designation', 'text', length=6, required=False, default=''),
-    migrate=migrate)
+    migrate='auth_roles.table', fake_migrate=fake_migrate)
 
 db.define_table('auth_users',
     # Whatever login name the user authenticated with
     Field('auth_created_on', 'datetime', required=True, default=request.now),
     Field('auth_modified_on', 'datetime', required=True, default=request.now),
     Field('is_enabled', 'boolean', required=True, default=True),
-    Field('auth_role_id', db.auth_roles), migrate=migrate)
+    Field('auth_role_id', db.auth_roles),
+    migrate='auth_users.table', fake_migrate=fake_migrate)
 
 # System Properties - Used by the system itself
 db.define_table('system_properties',
     Field('property_name', 'string', length=128, required=True),
     Field('property_desc', 'text', required=True),
-    Field('property_value', 'text', required=True), migrate=migrate)
+    Field('property_value', 'text', required=True),
+    migrate='system_properties.table', fake_migrate=fake_migrate)
 
 # Member Properties (Skeleton) (Available member Properties)
 db.define_table('member_properties_skel',
     Field('property_desc', 'text', required=True),
     Field('member_editable', 'boolean', default=False),
     Field('sort_order', 'integer', default=0, required=True),
-    migrate=migrate)
+    migrate='member_properties_skel.table', fake_migrate=fake_migrate)
 
 # Member Properties (For each member)
 db.define_table('member_properties',
     Field('auth_user', db.auth_users),
     Field('property_id', db.member_properties_skel),
     Field('property_value', 'string', length=255, required=True),
-    migrate=migrate)
+    migrate='member_properties.table', fake_migrate=fake_migrate)
 
 # Avatars
 db.define_table('member_avatars',
     Field('auth_user_id', 'integer', required=True),
     Field('avatar_image', 'blob', required=True, default=None),
     Field('avatar_active', 'boolean', required=True, default=True),
-    migrate=migrate)
+    migrate='member_properties.table', fake_migrate=fake_migrate)
 
 # Questions
 db.define_table('questions',
     Field('is_closed', 'boolean', required=True, default=False),
     Field('is_featured', 'boolean', required=True, default=False),
     Field('is_visible', 'boolean', required=True, default=True),
-    Field('views', 'integer', required=True, default=1), migrate=migrate)
+    Field('views', 'integer', required=True, default=1),
+    migrate='questions.table', fake_migrate=fake_migrate)
 
 # Answers
 db.define_table('answers',
     Field('is_answer', 'boolean', required=True, default=False),
     Field('is_visible', 'boolean', required=True, default=True),
     Field('is_outstanding', 'boolean', required=True, default=False),
-          migrate=migrate)
+    migrate='answers.table', fake_migrate=fake_migrate)
 
 # Comments - Comments get up/dn points but do not count towards
 # the user's profile
     Field('modified_by', db.auth_users),
     Field('modified_on', 'datetime', required=True),
     Field('is_visible', 'boolean', required=True, default=True),
-    migrate=migrate)
+    migrate='comments.table', fake_migrate=fake_migrate)
 
 # Score Log
 db.define_table('score_log',
     Field('qac_id', 'integer', required=True),
     Field('points', 'integer', required=True),
     Field('sender', db.auth_users),
-    Field('created_on', 'datetime', required=True), migrate=migrate)
+    Field('created_on', 'datetime', required=True),
+    migrate='score_log.table', fake_migrate=fake_migrate)
 
 # Simple Tag System
 db.define_table('tags',
     Field('tagname', 'string', required=True, length=255),
     Field('is_enabled', 'boolean', required=True, default=True),
-    migrate=migrate)
+    migrate='tags.table', fake_migrate=fake_migrate)
 
 # Tag/Question relationship
 db.define_table('question_tags',
     Field('question_id', db.questions),
-    Field('tag_id', db.tags), migrate=migrate)
+    Field('tag_id', db.tags),
+    migrate='question_tags.table', fake_migrate=fake_migrate)
 
 # Question Subscriptions - Everytime the user subscribes to a question,
 # an entry is made here
     Field('auth_user_id', db.auth_users),
     Field('question_id', db.questions),
     Field('is_active', 'boolean', default=True, required=True),
-    migrate=migrate)
+    migrate='question_subscriptions.table', fake_migrate=fake_migrate)
 
 # When a question is updated, an email notification would be sent to all the
 # Subscribed users, a record will be created here for the cron job to pick up
     Field('subscription_id', db.question_subscriptions),
     Field('created_on', 'datetime', required=True),
     Field('processed_on', 'datetime', required=False, default=None),
-    migrate=migrate) # Important
+    migrate='subscriptions_notification.table', fake_migrate=fake_migrate) # Important
 
 # "Queue" messages sent to the administrators (All admins can view )
 db.define_table('admin_messages',
     Field('message', 'text', required=True),
     Field('creation_date', 'datetime', required=True),
     Field('read_flag', 'boolean', default=False, required=True),
-    migrate=migrate)
+    migrate='admin_messages.table', fake_migrate=fake_migrate)
 
 # This code sets up some defaults if the system is installed
 # for the first time on a new instance.

sessions/.hidden

Empty file added.