Skip to content

Commit

Permalink
Revert "Fixing referential integrity"
Browse files Browse the repository at this point in the history
This reverts commit f27d20f.

This commit introduced a bug that can be see in in Issue 27
apache#27

The bug happens when the conn_id is not passed to the back-end
database.
  • Loading branch information
statwonk committed Jun 14, 2015
1 parent 62ad66e commit 0a78243
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions airflow/models.py
Expand Up @@ -1719,7 +1719,8 @@ class Chart(Base):

id = Column(Integer, primary_key=True)
label = Column(String(200))
conn_id = Column(String(ID_LEN), nullable=False)
conn_id = Column(
String(ID_LEN), ForeignKey('connection.conn_id'), nullable=False)
user_id = Column(Integer(), ForeignKey('user.id'),)
chart_type = Column(String(100), default="line")
sql_layout = Column(String(50), default="series")
Expand All @@ -1732,9 +1733,7 @@ class Chart(Base):
owner = relationship(
"User", cascade=False, cascade_backrefs=False, backref='charts')
x_is_date = Column(Boolean, default=True)
db = relationship(
"Connection",
primaryjoin='Chart.conn_id == foreign(Connection.conn_id)')
db = relationship("Connection")
iteration_no = Column(Integer, default=0)
last_modified = Column(DateTime, default=datetime.now())

Expand Down

0 comments on commit 0a78243

Please sign in to comment.