Ok merci pour votre aide.
J'ai changé le type de la colonne "VENTILATION" de la table "ACTIONS" (la table "PAIEMENTS" n'étant pas encore créée) mais cela n'a pas fonctionné.
J'ai également essayé en utilisant le fichier exemple_alsh et j'atteris sur la même erreur...
Voici le message d'erreur en entier.
C'est au moment des créations des tables pour le portail famille que ça coince ?
Code:
Lancement de Connecthys...
serveur=None host=0.0.0.0 port=5000
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Action.renseignements' will copy column portail_actions.IDaction to column portail_renseignements.IDaction, which conflicts with relationship(s): 'Renseignement.action' (copies portail_actions.IDaction to portail_renseignements.IDaction). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. To silence this warning, add the parameter 'overlaps="action"' to the 'Action.renseignements' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
mapper = orm.class_mapper(type)
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Reservation_location.action' will copy column portail_actions.IDaction to column portail_reservations_locations.IDaction, which conflicts with relationship(s): 'Action.reservations_locations' (copies portail_actions.IDaction to portail_reservations_locations.IDaction). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. To silence this warning, add the parameter 'overlaps="reservations_locations"' to the 'Reservation_location.action' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
mapper = orm.class_mapper(type)
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Periode.activite' will copy column portail_activites.IDactivite to column portail_periodes.IDactivite, which conflicts with relationship(s): 'Activite.periodes' (copies portail_activites.IDactivite to portail_periodes.IDactivite). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. To silence this warning, add the parameter 'overlaps="periodes"' to the 'Periode.activite' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
mapper = orm.class_mapper(type)
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Reservation.action' will copy column portail_actions.IDaction to column portail_reservations.IDaction, which conflicts with relationship(s): 'Action.reservations' (copies portail_actions.IDaction to portail_reservations.IDaction). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards. To silence this warning, add the parameter 'overlaps="reservations"' to the 'Reservation.action' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
mapper = orm.class_mapper(type)
[2022-04-04 09:55:31,718] INFO in models: Creation de la base de donnees MySQL si besoin...
[2022-04-04 09:55:31,726] INFO in models: Creation des tables des donnees...
Traceback (most recent call last):
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
self.dialect.do_execute(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
res = self._query(query)
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
db.query(q)
File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 226, in query
_mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1074, "Column length too big for column 'ventilation' (max = 16383); use BLOB or TEXT instead")
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "run.py", line 92, in <module>
from application import app
File "/home/ubuntu/connecthys/application/__init__.py", line 168, in <module>
models.CreationDB()
File "/home/ubuntu/connecthys/application/models.py", line 77, in CreationDB
db.create_all()
File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 1094, in create_all
self._execute_for_all_tables(app, bind, 'create_all')
File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 1086, in _execute_for_all_tables
op(bind=self.get_engine(app, bind), **extra)
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 4864, in create_all
bind._run_ddl_visitor(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3123, in _run_ddl_visitor
conn._run_ddl_visitor(visitorcallable, element, **kwargs)
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2119, in _run_ddl_visitor
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 524, in traverse_single
return meth(obj, **kw)
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 849, in visit_metadata
self.traverse_single(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 524, in traverse_single
return meth(obj, **kw)
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 893, in visit_table
self.connection.execute(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1295, in execute
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 80, in _execute_on_connection
return connection._execute_ddl(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1387, in _execute_ddl
ret = self._execute_context(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1851, in _execute_context
self._handle_dbapi_exception(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2032, in _handle_dbapi_exception
util.raise_(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
raise exception
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
self.dialect.do_execute(
File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
cursor.execute(statement, parameters)
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
res = self._query(query)
File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
db.query(q)
File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 226, in query
_mysql.connection.query(self, query)
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1074, "Column length too big for column 'ventilation' (max = 16383); use BLOB or TEXT instead")
[SQL:
CREATE TABLE portail_paiements (
`IDpaiement` INTEGER NOT NULL AUTO_INCREMENT,
`factures_ID` VARCHAR(50),
`IDfamille` INTEGER,
`IDtransaction` VARCHAR(50),
refdet VARCHAR(50),
montant FLOAT,
objet VARCHAR(50),
saisie VARCHAR(5),
resultrans VARCHAR(5),
numauto VARCHAR(10),
dattrans VARCHAR(15),
heurtrans VARCHAR(15),
systeme_paiement VARCHAR(50),
resultat VARCHAR(50),
message VARCHAR(450),
ventilation VARCHAR(100000),
horodatage DATETIME,
PRIMARY KEY (`IDpaiement`)
)
]
(Background on this error at: https://sqlalche.me/e/14/e3q8)