from minibase import db, create_minibase from minibase.database.models import Person, Person_role, Person_competence, Person_note from minibase.database.models import Company, Company_relation, Company_legal_entity, Company_note, Company_status from minibase.database.models import Status, Industry, Note_status #from minibase.database.models import Project app = create_minibase() app.app_context().push() db.drop_all() db.create_all() ################################################################################################### 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) ################################################################################################### companyStatus1 = Company_status( name='Activ', description='Company is active and business is running') db.session.add(companyStatus1) companyStatus2 = Company_status( name='Bankrupt', description='Company is bankrupt') db.session.add(companyStatus2) companyStatus3 = Company_status( name='Closed', description='Company is closed') db.session.add(companyStatus3) company1 = Company( name='Steinel', legal_entity_id='1', relation_id='1', industry_id='1', status_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', status_id='3', 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) noteStatus1 = Note_status( name='Open', description='Ongoing') db.session.add(noteStatus1) noteStatus2 = Note_status( name='Closed', description='Ongoing') db.session.add(noteStatus2) noteStatus3 = Note_status( name='Done', description='Ongoing') db.session.add(noteStatus3) note1 = Company_note( title='Need to find a valid MCU For Stefan', content='ST is not able to deliver F0 mcu so NXP may do the trick', priority='1', company_id='1', status_id='1') db.session.add(note1) note2 = Company_note( title='Need to find a valid LDO', content='Please find an LDO for 100mAh', priority='2', company_id='1', status_id='3') db.session.add(note2) note2 = Company_note( title='Please contact your custommers', content='I won\'t earn any money if i don\'t get in touch with them', priority='0', company_id='2', status_id='1') db.session.add(note2) ################################################################################################### 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) 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_competence( name='hardware', description='Electronics Hardwre specialist') db.session.add(PersonCompethence2) PersonCompethence3 = Person_competence( name='Software', description='Software engineer') db.session.add(PersonCompethence1) person1 = Person( name='Kerem', last_name='Yollu', company_id='2', role_id='3', competence_id='1', mail_prof='kerem.yollu@kynsight.com', mail_priv='kerem.yollu@gmail.com', tel_prof_mobile='+41789716697', street_name='Meierackerstrasse', street_no='10', city='Uster', post_code='8610', state='Zürich', country='Switzerland') db.session.add(person1) person2 = Person( name='Stefan', last_name='Walker', company_id='1', role_id='2', competence_id='2', mail_prof='stefan.walker@steinel.ch', mail_priv='stefan.walker@gmail.com', tel_prof_mobile='+4178956787', street_name='Alemeinrstrasse', street_no='10', city='Einsiedeln', post_code='8406', state='Schyz', country='Switzerland') db.session.add(person2) note3 = Person_note( title='Birthday of Stefan', content='Congratulate Stefan for his birthday', priority='5', person_id='2') #status_id='1') db.session.add(note3) note4 = Person_note( title='Wake Up kerem', content='He is still slepping', priority='10', person_id='1') #status_id='3') db.session.add(note4) note5 = Person_note( title='Research for Stefan', content='He is looking for a new job', priority='8', person_id='2') #status_id='2') db.session.add(note5) ''' project1 = Project( name='Stwa-Hs', description='Akku Sprüh Gerät für hautmittel!') # buyer='2', # responsible='1') db.session.add(project1) ################################################################################################### 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) ''' db.session.commit()