You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2018/07/03 13:09:57 UTC

[GitHub] ripoul opened a new issue #5333: my model definition and table created don't match

ripoul opened a new issue #5333: my model definition and table created don't match
URL: https://github.com/apache/incubator-superset/issues/5333
 
 
   Make sure these boxes are checked before submitting your issue - thank you!
   
   - [* ] I have checked the superset logs for python stacktraces and included it here as text if any
   - [*] I have reproduced the issue with at least the latest released version of superset
   - [*] I have checked the issue tracker for the same issue and I haven't found one similar
   
   
   ### Superset version
   0.23.0dev
   
   ### Expected results
   I have to had a model object in superset for personal need. I define my model, but the table created with "superset db migrate" and "superset db upgrade" do not match with my model.
   
   ### Actual results
   the new table do not match with my model
   
   ### Steps to reproduce
   add a model definition : 
   
   ```
   class StructureBudgetaire(Model, AuditMixinNullable, ImportMixin):
       #__bind_key__ = 'struct'
       __tablename__ = 'structure_budgetaire'
       numligne = Column(Integer, primary_key=True)
       imputation = Column(String(200))
       titre = Column(String(200))
       sousbudget = Column(String(100))
       regroupement = Column(String(100))
       journaux = Column(String(100))
       analytique = Column(String(100))
       cptessd = Column(String(200))
       cptessc = Column(String(200))
       cptesexclu = Column(String(200))
       type_budget = Column(String(2))
       
   
       export_fields = ('numligne', 'imputation', 'titre',
                        'sousbudget', 'regroupement', 'journaux', 'analytique', 'cptessd', 'cptessc', 'cptesexclu', 'type_budget')
   ```
   
   migrate and upgrade
   
   and here the table created with for example the first two lines i don't want to : 
   ```
   CREATE TABLE structure_budgetaire (
   	created_on DATETIME, 
   	changed_on DATETIME, 
   	numligne INTEGER NOT NULL, 
   	imputation VARCHAR(200), 
   	titre VARCHAR(200), 
   	sousbudget VARCHAR(100), 
   	regroupement VARCHAR(100), 
   	journaux VARCHAR(100), 
   	analytique VARCHAR(100), 
   	cptessd VARCHAR(200), 
   	cptessc VARCHAR(200), 
   	cptesexclu VARCHAR(200), 
   	type_budget VARCHAR(2), 
   	changed_by_fk INTEGER, 
   	created_by_fk INTEGER, 
   	PRIMARY KEY (numligne), 
   	FOREIGN KEY(changed_by_fk) REFERENCES ab_user (id), 
   	FOREIGN KEY(created_by_fk) REFERENCES ab_user (id)
   );
   ```
   
   
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org