Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # schema.yml of moneyMaintance
- User:
- columns:
- username:
- type: string(255)
- notnull: true
- password:
- type: string(255)
- notnull: true
- indexes:
- userUsername:
- fields: [username]
- type: unique
- relations:
- BankAccounts:
- type: many
- class: BankAccout
- local: id
- foreign: user_id
- onDelete: CASCADE
- Bills:
- type: many
- class: Bill
- local: id
- foreign: user_id
- onDelete: CASCADE
- BankAccount:
- columns:
- name:
- type: string(255)
- notnull: true
- credit: float
- user_id: integer
- relations:
- User:
- local: user_id
- foreign: id
- foreignAlias: BankAccounts
- onDelete: CASCADE
- Bills:
- type: many
- class: Bill
- local: id
- foreign: bankAccount_id
- onDelete: CASCADE
- Bill:
- columns:
- size: float
- name:
- type: string(255)
- notnull: true
- user_id: integer
- bankAccount_id: integer
- indexes:
- billName:
- fields: [name]
- type: unique
- relations:
- BankAccount:
- local: bankAccount_id
- foreign: id
- onDelete: CASCADE
- User:
- local: user_id
- foreign: id
- onDelete: CASCADE
- Articles:
- class: Article
- local: bill_id
- foreign: article_id
- refClass: BillArticle
- cascade: [delete]
- Article:
- columns:
- name:
- type: string(255)
- notnull: true
- price: float
- category_id: integer
- indexes:
- articleName:
- fields: [name]
- type: unique
- articlePrice:
- fields: [price]
- relations:
- Category:
- local: category_id
- foreign: id
- foreignAlias: Articles
- onDelete: SET NULL
- Bills:
- class: Bill
- local: article_id
- foreign: bill_id
- refClass: BillArticle
- cascade: [delete]
- Category:
- columns:
- name:
- type: string(255)
- notnull: true
- indexes:
- categoryName:
- fields: [name]
- type: unique
- relations:
- Articles:
- type: many
- class: Article
- local: id
- foreign: category_id
- #onDelete: NULL
- # MANY TO MANY CLASSES!
- BillArticle:
- columns:
- bill_id:
- type: integer
- primary: true
- article_id:
- type: integer
- primary: true
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement