Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: remove events-orga endpoint #6714

Merged
merged 1 commit into from
Jan 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions app/api/event_orga.py

This file was deleted.

6 changes: 0 additions & 6 deletions app/api/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from app.api.event_invoices import EventInvoiceList, EventInvoiceDetail, \
EventInvoiceRelationshipRequired, EventInvoiceRelationshipOptional
from app.api.event_locations import EventLocationList
from app.api.event_orga import EventOrgaDetail
from app.api.event_statistics import EventStatisticsGeneralDetail
from app.api.event_sub_topics import EventSubTopicList, EventSubTopicListPost, EventSubTopicDetail, \
EventSubTopicRelationshipRequired, EventSubTopicRelationshipOptional
Expand Down Expand Up @@ -301,8 +300,6 @@
'/events/<identifier>/relationships/event-type')
api.route(EventRelationship, 'event_event_topic', '/events/<int:id>/relationships/event-topic',
'/events/<identifier>/relationships/event-topic')
api.route(EventRelationship, 'events_orga', '/events/<int:id>/relationships/event-orga',
'/events/<identifier>/relationships/event-orga')
api.route(EventRelationship, 'event_event_sub_topic', '/events/<int:id>/relationships/event-sub-topic',
'/events/<identifier>/relationships/event-sub-topic')
api.route(EventRelationship, 'event_role_invite', '/events/<int:id>/relationships/role-invites',
Expand Down Expand Up @@ -530,9 +527,6 @@
api.route(EventTopicRelationship, 'event_topic_event_sub_topic',
'/event-topics/<int:id>/relationships/event-sub-topics')

# event orga
api.route(EventOrgaDetail, 'event_orga_detail', '/events/<event_identifier>/event-orga',
'/events/<int:event_id>/event-orga')

# event sub topics
api.route(EventSubTopicListPost, 'event_sub_topic_list_post', '/event-sub-topics')
Expand Down
7 changes: 0 additions & 7 deletions app/api/schema/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,6 @@ def validate_timezone(self, data, original_data):
related_view_kwargs={'event_id': '<id>'},
schema='EventTopicSchema',
type_='event-topic')
event_orga = Relationship(attribute='events_orga',
self_view='v1.events_orga',
self_view_kwargs={'id': '<id>'},
related_view='v1.event_orga_detail',
related_view_kwargs={'event_id': '<id>'},
schema='EventOrgaSchema',
type='event-orga')
event_sub_topic = Relationship(attribute='event_sub_topic',
self_view='v1.event_event_sub_topic',
self_view_kwargs={'id': '<id>'},
Expand Down
53 changes: 0 additions & 53 deletions app/api/schema/events_orga.py

This file was deleted.

6 changes: 0 additions & 6 deletions app/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ class Event(SoftDeletionModel):
event_topic_id = db.Column(db.Integer, db.ForeignKey('event_topics.id', ondelete='CASCADE'))
event_sub_topic_id = db.Column(db.Integer, db.ForeignKey(
'event_sub_topics.id', ondelete='CASCADE'))
events_orga_id = db.Column(db.Integer, db.ForeignKey(
'events_orga.id', ondelete='CASCADE'))
ticket_url = db.Column(db.String)
db.UniqueConstraint('track.name')
code_of_conduct = db.Column(db.String)
Expand Down Expand Up @@ -123,8 +121,6 @@ class Event(SoftDeletionModel):
event_topic = db.relationship('EventTopic', backref='event', foreign_keys=[event_topic_id])
event_sub_topic = db.relationship(
'EventSubTopic', backref='event', foreign_keys=[event_sub_topic_id])
events_orga = db.relationship(
'EventOrgaModel', backref='event', foreign_keys=[events_orga_id])
owner = db.relationship('User',
viewonly=True,
secondary='join(UsersEventsRoles, Role,'
Expand Down Expand Up @@ -201,7 +197,6 @@ def __init__(self,
privacy=None,
event_topic_id=None,
event_sub_topic_id=None,
events_orga_id=None,
ticket_url=None,
copyright=None,
code_of_conduct=None,
Expand Down Expand Up @@ -272,7 +267,6 @@ def __init__(self,
self.show_remaining_tickets = show_remaining_tickets
self.copyright = copyright
self.event_sub_topic_id = event_sub_topic_id
self.events_orga_id = events_orga_id
self.ticket_url = ticket_url
self.code_of_conduct = code_of_conduct
self.schedule_published_on = schedule_published_on
Expand Down
42 changes: 42 additions & 0 deletions migrations/versions/rev-2020-01-03-08:17:26-dee1ad7bee53_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
"""empty message

Revision ID: dee1ad7bee53
Revises: 8621f70992ba
Create Date: 2020-01-03 08:17:26.193852

"""

from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = 'dee1ad7bee53'
down_revision = '8621f70992ba'


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_constraint('events_events_orga_id_fkey', 'events', type_='foreignkey')
op.drop_column('events', 'events_orga_id')
op.drop_column('events_version', 'events_orga_id')
op.drop_table('events_orga')
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('events_orga',
sa.Column('deleted_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('starts_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
sa.Column('payment_currency', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='events_orga_pkey')
)
op.add_column('events_version', sa.Column('events_orga_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('events', sa.Column('events_orga_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_foreign_key('events_events_orga_id_fkey', 'events', 'events_orga', ['events_orga_id'], ['id'],
ondelete='CASCADE')
# ### end Alembic commands ###