Merge branch 'collection' of csgitlab.ucd.ie:19206226/q-a_platform into collection
Conflicts: data-dev.sqlitemerge-requests/3/head
commit
c7c3df1dca
@ -0,0 +1,133 @@
|
||||
|
||||
|
||||
<li class="post" id="{{ post.id }}">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body">
|
||||
<div class="post-content col-sm-12">
|
||||
{# 标题#}
|
||||
{# <h3 class="post-title" style="margin-top: 7px">#}
|
||||
{# <a href="{{ url_for('.post', id=post.id) }}">#}
|
||||
{# {{ post.title }}#}
|
||||
{# </a>#}
|
||||
{# </h3>#}
|
||||
{# 摘要#}
|
||||
<div class="post-body">
|
||||
<p>
|
||||
{% if post.body_html %}
|
||||
{{ post.body_html |safe|striptags|truncate(260,killwords=Flase,leeway=0) }}
|
||||
{% else %}
|
||||
{{ post.body |truncate(200,killwords=Flase,leeway=0)}}
|
||||
{% endif %}
|
||||
<small><a href="{{ url_for('.post', id=post.id) }}"><B>Read More</B></a></small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="panel-footer">
|
||||
{% if post.is_anonymous %}
|
||||
<div class="post-thumbnail">
|
||||
<span class="head-photo">
|
||||
<img class="img-rounded profile-thumbnail" src="{{ url_for('static',filename='Image/anonymous.png') }}" alt="avatar" style="width: 25px; height: 25px">
|
||||
</span>
|
||||
|
||||
<span class="post-author">
|
||||
<span> anonymous </span>
|
||||
</span>
|
||||
<span class="post-date"><small>{{ moment(post.timestamp).fromNow() }}</small></span>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="post-thumbnail">
|
||||
|
||||
<a class="head-photo" href="{{ url_for('.user', username=post.author.username) }}">
|
||||
{% if post.author.avatar_img %}
|
||||
<img class="img-rounded profile-thumbnail" src="{{ post.author.avatar_img }}" alt="avatar" style="width: 25px; height: 25px">
|
||||
{% else %}
|
||||
<img class="img-rounded profile-thumbnail" src="{{ post.author.gravatar(size=25) }}" alt="avatar">
|
||||
{% endif %}
|
||||
</a>
|
||||
|
||||
<span class="post-author">
|
||||
<a href="{{ url_for('.user', username=post.author.username) }}">
|
||||
{{ post.author.username }}
|
||||
{% if post.author.can(Permission.ACTIVITY) %}
|
||||
<svg class="icon" viewBox="0 0 1024 1024" width="14" height="14" style="margin: 0">
|
||||
<path d="M959.786667 148.906667l-44.330667-0.725333c-1.024 0-100.437333-2.048-203.050667-41.728-105.301333-40.789333-173.141333-87.552-173.781333-88.021333L511.872 0 485.248 18.474667C484.608 18.901333 416.768 65.706667 311.466667 106.453333 208.938667 146.218667 109.482667 148.181333 108.544 148.181333L64 148.906667l0 430.464C64 795.477333 355.328 1024 511.957333 1024 668.714667 1024 960 795.477333 960 579.370667L959.786667 148.906667zM321.877333 772.48 321.877333 355.413333 282.112 355.413333 282.112 317.482667 441.173333 317.482667l0 189.610667 200.192-189.610667 157.696 0L321.877333 772.48z" fill="#3688FF"></path>
|
||||
</svg>
|
||||
{% endif %}
|
||||
</a>
|
||||
</span>
|
||||
<span class="post-date"><small>{{ moment(post.timestamp).fromNow() }}</small></span>
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="post-footer">
|
||||
|
||||
{# 评论#}
|
||||
<a class="icon-btn" style="float:right" href="{{ url_for('.post', id=post.id) }}#comments">
|
||||
<span class="glyphicon glyphicon-comment"></span>
|
||||
<span>{{ post.comments.count() }} comment</span>
|
||||
</a>
|
||||
|
||||
{# 喜欢#}
|
||||
{# {% if not current_user.is_liking(post) %}#}
|
||||
{# <a class="icon-btn" style="float:right; margin-right: 15px" href="{{ url_for('.like', post_id=post.id) }}#{{ post.id }}">#}
|
||||
{# <span class="glyphicon glyphicon-heart-empty"></span>#}
|
||||
{# <span>{{ post.liker.count() }} likes</span>#}
|
||||
{# </a>#}
|
||||
<a class="icon-btn" style="float:right; margin-right: 15px" href="javascript:void (0);" onclick="{
|
||||
var csrftoken = $('meta[name=csrf-token]').attr('content');
|
||||
var _this=this;
|
||||
var span1=this.childNodes[1];
|
||||
var span2=this.childNodes[3];
|
||||
{#console.log(this.childNodes[3]);#}
|
||||
{#console.log(this.childElementCount);#}
|
||||
var sendData={
|
||||
'csrf_token':csrftoken
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url_for('.AJAXlike', post_id=post.id) }}',
|
||||
type: 'POST',
|
||||
{#dataType: 'json',#}
|
||||
{#contentType: 'application/json',#}
|
||||
{#data: JSON.stringify(sendData),#}
|
||||
|
||||
success: function(result) {
|
||||
console.log('success\n'+result);
|
||||
if(result.like){
|
||||
span1.setAttribute('class', 'glyphicon glyphicon-heart');
|
||||
}else{
|
||||
span1.setAttribute('class', 'glyphicon glyphicon-heart-empty');
|
||||
}
|
||||
span2.innerText=result.num+' likes';
|
||||
{#span1.setAttribute('href', '{{ url_for('.dislike', post_id=post.id) }}');#}
|
||||
},
|
||||
error:function(msg){
|
||||
console.log(msg);
|
||||
if(msg.status===403){
|
||||
window.location.href='{{ url_for('auth.login') }}'
|
||||
}
|
||||
}
|
||||
})
|
||||
}">
|
||||
{% if not current_user.is_liking(post) %}
|
||||
<span class="glyphicon glyphicon-heart-empty"></span>
|
||||
{% else %}
|
||||
<span class="glyphicon glyphicon-heart"></span>
|
||||
{% endif %}
|
||||
<span>{{ post.liker.count() }} likes</span>
|
||||
|
||||
</a>
|
||||
{# {% else %}#}
|
||||
{# <a class="icon-btn" style="float:right; margin-right: 15px" href="{{ url_for('.dislike', post_id=post.id) }}#{{ post.id }}">#}
|
||||
{# <span class="glyphicon glyphicon-heart"></span>#}
|
||||
{# <span>{{ post.liker.count() }} likes</span>#}
|
||||
{# </a>#}
|
||||
{# {% endif %}#}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
@ -0,0 +1,46 @@
|
||||
<ul class="posts list-unstyled">
|
||||
{% for post in concernAnswers %}
|
||||
{% if post.is_anonymous==False %}
|
||||
<li class="post">
|
||||
<div class="post-box">
|
||||
|
||||
<div class="post-content">
|
||||
<h3 class="post-title">
|
||||
<a href="{{ url_for('.post', id=post.id) }}">{{ post.title }}</a>
|
||||
</h3>
|
||||
<div class="post-body">
|
||||
<p>
|
||||
{% if post.body_html %}
|
||||
{{ post.body_html |safe|striptags|truncate(260,killwords=Flase,leeway=0) }}
|
||||
{% else %}
|
||||
{{ post.body |truncate(200,killwords=Flase,leeway=0)}}
|
||||
{% endif %}
|
||||
<small><a href="{{ url_for('.post', id=post.id) }}"><B>Read More</B></a></small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="post-footer">
|
||||
<span class="post-date">
|
||||
<span class="glyphicon glyphicon-time"></span>
|
||||
{{ moment(post.timestamp).fromNow() }}
|
||||
</span>
|
||||
{% if current_user == post.author %}
|
||||
|
||||
{# 删除#}
|
||||
<a class="icon-btn" href="{{ url_for('main.delete_post_inProfile', post_id=post.id)}}">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
<span>delete</span>
|
||||
</a>
|
||||
{# 修改 #}
|
||||
<a class="icon-btn" href="#">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>modification</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
@ -0,0 +1,46 @@
|
||||
<ul class="posts list-unstyled">
|
||||
{% for post in concernQuestions %}
|
||||
{% if post.is_anonymous==False %}
|
||||
<li class="post">
|
||||
<div class="post-box">
|
||||
|
||||
<div class="post-content">
|
||||
<h3 class="post-title">
|
||||
<a href="{{ url_for('.post', id=post.id) }}">{{ post.title }}</a>
|
||||
</h3>
|
||||
<div class="post-body">
|
||||
<p>
|
||||
{% if post.body_html %}
|
||||
{{ post.body_html |safe|striptags|truncate(260,killwords=Flase,leeway=0) }}
|
||||
{% else %}
|
||||
{{ post.body |truncate(200,killwords=Flase,leeway=0)}}
|
||||
{% endif %}
|
||||
<small><a href="{{ url_for('.post', id=post.id) }}"><B>Read More</B></a></small>
|
||||
</p>
|
||||
</div>
|
||||
<div class="post-footer">
|
||||
<span class="post-date">
|
||||
<span class="glyphicon glyphicon-time"></span>
|
||||
{{ moment(post.timestamp).fromNow() }}
|
||||
</span>
|
||||
{% if current_user == post.author %}
|
||||
|
||||
{# 删除#}
|
||||
<a class="icon-btn" href="{{ url_for('main.delete_post_inProfile', post_id=post.id)}}">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
<span>delete</span>
|
||||
</a>
|
||||
{# 修改 #}
|
||||
<a class="icon-btn" href="#">
|
||||
<span class="glyphicon glyphicon-pencil"></span>
|
||||
<span>modification</span>
|
||||
</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ul>
|
@ -0,0 +1,14 @@
|
||||
from aip import AipContentCensor
|
||||
|
||||
""" 你的 APPID AK SK """
|
||||
APP_ID = '11752086'
|
||||
API_KEY = 'OfTS5Nkkbo3Qt9VuZlK0izao'
|
||||
SECRET_KEY = 'sPUzVHGlHYCcqTxmcaZOINk2OOBMZlZI'
|
||||
|
||||
client = AipContentCensor(APP_ID, API_KEY, SECRET_KEY)
|
||||
print(client.getVersion())
|
||||
|
||||
def check_text(text: str):
|
||||
""" 调用文本审核接口 """
|
||||
result = client.textCensorUserDefined(text)
|
||||
return result
|
Binary file not shown.
@ -1 +1 @@
|
||||
Generic single-database configuration.
|
||||
Single-database configuration for Flask.
|
||||
|
@ -1,240 +0,0 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: d3c0f90744f6
|
||||
Revises:
|
||||
Create Date: 2020-05-26 15:21:36.410197
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'd3c0f90744f6'
|
||||
down_revision = None
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('organizations',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('confirmed', sa.Boolean(), nullable=True),
|
||||
sa.Column('name', sa.String(length=64), nullable=True),
|
||||
sa.Column('teacher', sa.String(length=128), nullable=True),
|
||||
sa.Column('leader_student', sa.String(length=128), nullable=True),
|
||||
sa.Column('phone', sa.String(length=128), nullable=True),
|
||||
sa.Column('college', sa.String(length=256), nullable=True),
|
||||
sa.Column('email', sa.String(length=64), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_table('roles',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('name', sa.String(length=64), nullable=True),
|
||||
sa.Column('default', sa.Boolean(), nullable=True),
|
||||
sa.Column('permissions', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('id'),
|
||||
sa.UniqueConstraint('name')
|
||||
)
|
||||
with op.batch_alter_table('roles', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_roles_default'), ['default'], unique=False)
|
||||
|
||||
op.create_table('students',
|
||||
sa.Column('student_id', sa.Integer(), nullable=False),
|
||||
sa.Column('id_number', sa.String(length=18), nullable=True),
|
||||
sa.Column('confirmed', sa.Boolean(), nullable=True),
|
||||
sa.Column('role_id', sa.Integer(), nullable=True),
|
||||
sa.PrimaryKeyConstraint('student_id')
|
||||
)
|
||||
with op.batch_alter_table('students', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_students_role_id'), ['role_id'], unique=False)
|
||||
|
||||
op.create_table('users',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('ID_number', sa.Integer(), nullable=True),
|
||||
sa.Column('student_id', sa.Integer(), nullable=True),
|
||||
sa.Column('confirmed', sa.Boolean(), nullable=True),
|
||||
sa.Column('email', sa.String(length=64), nullable=True),
|
||||
sa.Column('username', sa.String(length=64), nullable=True),
|
||||
sa.Column('password_hash', sa.String(length=128), nullable=True),
|
||||
sa.Column('role_id', sa.Integer(), nullable=True),
|
||||
sa.Column('grade', sa.String(length=4), nullable=True),
|
||||
sa.Column('college', sa.String(length=64), nullable=True),
|
||||
sa.Column('about_me', sa.Text(), nullable=True),
|
||||
sa.Column('member_since', sa.DateTime(), nullable=True),
|
||||
sa.Column('last_seen', sa.DateTime(), nullable=True),
|
||||
sa.Column('avatar_hash', sa.String(length=32), nullable=True),
|
||||
sa.Column('avatar_img', sa.String(length=120), nullable=True),
|
||||
sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_users_ID_number'), ['ID_number'], unique=True)
|
||||
batch_op.create_index(batch_op.f('ix_users_email'), ['email'], unique=True)
|
||||
batch_op.create_index(batch_op.f('ix_users_student_id'), ['student_id'], unique=True)
|
||||
batch_op.create_index(batch_op.f('ix_users_username'), ['username'], unique=True)
|
||||
|
||||
op.create_table('Activity',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.Column('activity_name', sa.String(length=256), nullable=False),
|
||||
sa.Column('activity_time', sa.DateTime(), nullable=False),
|
||||
sa.Column('activity_place', sa.String(length=256), nullable=False),
|
||||
sa.Column('activity_describe', sa.String(length=256), nullable=False),
|
||||
sa.Column('Organizer', sa.String(length=256), nullable=False),
|
||||
sa.Column('is_schoolAgree', sa.Boolean(), nullable=False),
|
||||
sa.Column('is_invalid', sa.Boolean(), nullable=True),
|
||||
sa.Column('important', sa.INTEGER(), nullable=True),
|
||||
sa.Column('announcer_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['announcer_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('Activity', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_Activity_timestamp'), ['timestamp'], unique=False)
|
||||
|
||||
op.create_table('follow',
|
||||
sa.Column('follower_id', sa.Integer(), nullable=False),
|
||||
sa.Column('followed_id', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['followed_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['follower_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('follower_id', 'followed_id')
|
||||
)
|
||||
op.create_table('notification',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('username', sa.String(length=64), nullable=False),
|
||||
sa.Column('action', sa.Text(), nullable=False),
|
||||
sa.Column('object', sa.String(length=64), nullable=False),
|
||||
sa.Column('object_id', sa.Integer(), nullable=True),
|
||||
sa.Column('is_read', sa.Boolean(), nullable=True),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.Column('receiver_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['receiver_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('notification', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_notification_timestamp'), ['timestamp'], unique=False)
|
||||
|
||||
op.create_table('posts',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('title', sa.Text(), nullable=True),
|
||||
sa.Column('body', sa.Text(), nullable=True),
|
||||
sa.Column('body_html', sa.Text(), nullable=True),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.Column('author_id', sa.Integer(), nullable=True),
|
||||
sa.Column('important', sa.INTEGER(), nullable=True),
|
||||
sa.Column('recent_activity', sa.DateTime(), nullable=True),
|
||||
sa.Column('is_anonymous', sa.Boolean(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('posts', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_posts_recent_activity'), ['recent_activity'], unique=False)
|
||||
batch_op.create_index(batch_op.f('ix_posts_timestamp'), ['timestamp'], unique=False)
|
||||
|
||||
op.create_table('transaction',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.Column('item_name', sa.String(length=64), nullable=False),
|
||||
sa.Column('item_describe', sa.Text(), nullable=False),
|
||||
sa.Column('link', sa.Text(), nullable=False),
|
||||
sa.Column('transaction_mode', sa.String(length=64), nullable=False),
|
||||
sa.Column('is_sold', sa.Boolean(), nullable=True),
|
||||
sa.Column('seller_WeChat', sa.Text(), nullable=False),
|
||||
sa.Column('seller_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['seller_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('transaction', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_transaction_timestamp'), ['timestamp'], unique=False)
|
||||
|
||||
op.create_table('collect',
|
||||
sa.Column('collecter_id', sa.Integer(), nullable=False),
|
||||
sa.Column('collected_transaction_id', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['collected_transaction_id'], ['transaction.id'], ),
|
||||
sa.ForeignKeyConstraint(['collecter_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('collecter_id', 'collected_transaction_id')
|
||||
)
|
||||
op.create_table('comments',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('body', sa.Text(), nullable=True),
|
||||
sa.Column('body_html', sa.Text(), nullable=True),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.Column('disabled', sa.Boolean(), nullable=True),
|
||||
sa.Column('author_id', sa.Integer(), nullable=True),
|
||||
sa.Column('post_id', sa.Integer(), nullable=True),
|
||||
sa.Column('is_anonymous', sa.Boolean(), nullable=True),
|
||||
sa.Column('replied_id', sa.Integer(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
|
||||
sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
|
||||
sa.ForeignKeyConstraint(['replied_id'], ['comments.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
with op.batch_alter_table('comments', schema=None) as batch_op:
|
||||
batch_op.create_index(batch_op.f('ix_comments_timestamp'), ['timestamp'], unique=False)
|
||||
|
||||
op.create_table('likes',
|
||||
sa.Column('liker_id', sa.Integer(), nullable=False),
|
||||
sa.Column('liked_post_id', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['liked_post_id'], ['posts.id'], ),
|
||||
sa.ForeignKeyConstraint(['liker_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('liker_id', 'liked_post_id')
|
||||
)
|
||||
op.create_table('want',
|
||||
sa.Column('wanter_id', sa.Integer(), nullable=False),
|
||||
sa.Column('wanted_Activity_id', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.DateTime(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['wanted_Activity_id'], ['Activity.id'], ),
|
||||
sa.ForeignKeyConstraint(['wanter_id'], ['users.id'], ),
|
||||
sa.PrimaryKeyConstraint('wanter_id', 'wanted_Activity_id')
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_table('want')
|
||||
op.drop_table('likes')
|
||||
with op.batch_alter_table('comments', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_comments_timestamp'))
|
||||
|
||||
op.drop_table('comments')
|
||||
op.drop_table('collect')
|
||||
with op.batch_alter_table('transaction', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_transaction_timestamp'))
|
||||
|
||||
op.drop_table('transaction')
|
||||
with op.batch_alter_table('posts', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_posts_timestamp'))
|
||||
batch_op.drop_index(batch_op.f('ix_posts_recent_activity'))
|
||||
|
||||
op.drop_table('posts')
|
||||
with op.batch_alter_table('notification', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_notification_timestamp'))
|
||||
|
||||
op.drop_table('notification')
|
||||
op.drop_table('follow')
|
||||
with op.batch_alter_table('Activity', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_Activity_timestamp'))
|
||||
|
||||
op.drop_table('Activity')
|
||||
with op.batch_alter_table('users', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_users_username'))
|
||||
batch_op.drop_index(batch_op.f('ix_users_student_id'))
|
||||
batch_op.drop_index(batch_op.f('ix_users_email'))
|
||||
batch_op.drop_index(batch_op.f('ix_users_ID_number'))
|
||||
|
||||
op.drop_table('users')
|
||||
with op.batch_alter_table('students', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_students_role_id'))
|
||||
|
||||
op.drop_table('students')
|
||||
with op.batch_alter_table('roles', schema=None) as batch_op:
|
||||
batch_op.drop_index(batch_op.f('ix_roles_default'))
|
||||
|
||||
op.drop_table('roles')
|
||||
op.drop_table('organizations')
|
||||
# ### end Alembic commands ###
|
Loading…
Reference in New Issue