Skip to content

Commit

Permalink
Updated table names and readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
SaaS-Idea committed Nov 23, 2018
1 parent 97122ae commit 7c4e63a
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ python -m venv venv
3. Add necessarily environment variables:
* Find venv/Scripts/activate.bat file, open in a text editor (__Important! Don't use Notepad++ as for some reason it spoils the file.__)
* Add the following variables before _:END_:
* set FLASK_APP=main
* set FLASK_APP=application
* set env=dev
* set "db_url=postgres://user:password@dbhost:port/database"
* set "secret_key=your_local_secret_key"
Expand Down
2 changes: 1 addition & 1 deletion app/units/auth/models/role_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


class Role(db.Model):
__tablename__ = 'Role'
__tablename__ = 'role'
id = db.Column(UUID(as_uuid=True),
primary_key=True, default=lambda: uuid.uuid4().hex)
is_default = db.Column(db.Boolean, default=False, server_default='f')
Expand Down
6 changes: 3 additions & 3 deletions app/units/auth/models/user_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@


class User(UserMixin, db.Model):
__tablename__ = 'User'
__tablename__ = 'user'
id = db.Column(UUID(as_uuid=True),
primary_key=True, default=lambda: uuid.uuid4().hex)
email = db.Column(db.String(64), unique=True)
username = db.Column(db.String(64))
password_hash = db.Column(db.String(128))
role_id = db.Column(UUID(as_uuid=True), db.ForeignKey('Role.id'))
role_id = db.Column(UUID(as_uuid=True), db.ForeignKey('role.id'))
confirmed = db.Column(db.Boolean, default=False)
subscribed = db.Column(db.Boolean, default=False)
account_id = db.Column(UUID(as_uuid=True), db.ForeignKey('Account.id'))
account_id = db.Column(UUID(as_uuid=True), db.ForeignKey('account.id'))
account = db.relationship('Account', back_populates='user')

def __init__(self, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions app/units/billing/models/account_history_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@


class AccountHistory(db.Model):
__tablename__ = 'AccountHistory'
__tablename__ = 'account_history'
id = db.Column(UUID(as_uuid=True), primary_key=True, default=lambda: uuid.uuid4().hex)
account_id = db.Column(UUID(as_uuid=True), db.ForeignKey('Account.id'))
account_id = db.Column(UUID(as_uuid=True), db.ForeignKey('account.id'))
date = db.Column(db.DateTime(), nullable=True)
event = db.Column(db.String(32), nullable=True) # Some text representation of event
comment = db.Column(db.String(128)) # Text comment
Expand Down
2 changes: 1 addition & 1 deletion app/units/billing/models/account_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


class Account(db.Model):
__tablename__ = 'Account'
__tablename__ = 'account'
id = db.Column(UUID(as_uuid=True), primary_key=True, default=lambda: uuid.uuid4().hex)
user = db.relationship('User', back_populates='account')
account_history = db.relationship("AccountHistory", backref='account', lazy='dynamic')
Expand Down

0 comments on commit 7c4e63a

Please sign in to comment.