You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
3.6 KiB

from minibase import db, create_minibase
from minibase.database.models import Person, Person_role, Person_competence
from minibase.database.models import Company, Company_relation, Company_legal_entity
from minibase.database.models import Status, Industry
app = create_minibase()
app.app_context().push()
db.drop_all()
db.create_all()
###################################################################################################
PeresonRole1 = Person_role(
name='Engineer',
description='Standart Engineer')
db.session.add(PeresonRole1)
PeresonRole2 = Person_role(
name='Engineerin Manager',
description='Manager for egineering')
db.session.add(PeresonRole2)
db.session.commit()
PeresonRole3 = Person_role(
name='CEO',
description='Chief Executif Operation')
db.session.add(PeresonRole1)
PersonCompethence1 = Person_competence(
name='Embedded Systems',
description='Embedded Systems Engineer')
db.session.add(PersonCompethence1)
PersonCompethence2 = Person_role(
name='hardware',
description='Electronics Hardwre specialist')
db.session.add(PersonCompethence2)
PersonCompethence3 = Person_role(
name='Software',
description='Software engineer')
db.session.add(PersonCompethence1)
###################################################################################################
industry1 = Industry(
name='Industrial',
description="Active in Industrial area")
db.session.add(industry1)
industry2 = Industry(
name='Consumer',
description="Active in Consumer area")
db.session.add(industry1)
companyRelation1 = Company_relation(
name='Customer',
description="Only Buyiong customer")
db.session.add(companyRelation1)
companyRelation2 = Company_relation(
name='Supplier',
description="Only Selling customer")
db.session.add(companyRelation2)
companyRelation3 = Company_relation(
name='Collaborator',
description="Buying and Selling customer")
db.session.add(companyRelation2)
companyLegal1 = Company_legal_entity(
name='AG',
description='AktienGezelschaft')
db.session.add(companyLegal1)
companyLegal2 = Company_legal_entity(
name='GMBH',
description='Gesellschaft mit beschränkter Haftung')
db.session.add(companyLegal2)
###################################################################################################
status1 = Status(
name='Obsolete',
description='Obsolete from Manufacturer')
db.session.add(status1)
status2 = Status(
name='Active',
description='Everything is in order')
db.session.add(status2)
###################################################################################################
company1 = Company(
name='Steinel',
legal_entity_id='1',
relation_id='1',
industry_id='1',
website='www.steinel.ch',
street_bill='Alemeinrstrasse',
street_no_bill='10',
city_bill='Einsiedeln',
post_code_bill='8406',
state_bill='Schyz',
country_bill='Switzerland',
street_ship='Alemeinrstrasse',
street_no_ship='10',
city_ship='Einsiedeln',
post_code_ship='8406',
state_ship='Schyz',
country_ship='Switzerland')
db.session.add(company1)
company2 = Company(
name='Kynsight',
legal_entity_id='1',
relation_id='1',
industry_id='1',
website='www.kynsight.com',
street_bill='Meierackerstrasse',
street_no_bill='10',
city_bill='Uster',
post_code_bill='8610',
state_bill='Zürich',
country_bill='Switzerland',
street_ship='Meierackerstrasse',
street_no_ship='10',
city_ship='Uster',
post_code_ship='8610',
state_ship='Zürich',
country_ship='Switzerland')
db.session.add(company2)
db.session.commit()