Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
0722483e
Commit
0722483e
authored
7 years ago
by
user
Browse files
Options
Downloads
Patches
Plain Diff
[schema] minor tweak
parent
f95538a4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/schema.py
+173
-150
173 additions, 150 deletions
hive/schema.py
with
173 additions
and
150 deletions
hive/schema.py
+
173
−
150
View file @
0722483e
import
logging
import
logging
import
os
import
sqlalchemy
as
sa
import
sqlalchemy
as
sa
from
sqlalchemy.dialects.mysql
import
(
from
sqlalchemy.dialects.mysql
import
(
...
@@ -8,159 +9,181 @@ from sqlalchemy.dialects.mysql import (
...
@@ -8,159 +9,181 @@ from sqlalchemy.dialects.mysql import (
metadata
=
sa
.
MetaData
()
metadata
=
sa
.
MetaData
()
hive_blocks
=
sa
.
Table
(
'
hive_blocks
'
,
metadata
,
hive_blocks
=
sa
.
Table
(
sa
.
Column
(
'
num
'
,
sa
.
Integer
,
primary_key
=
True
,
autoincrement
=
False
),
'
hive_blocks
'
,
metadata
,
sa
.
Column
(
'
prev
'
,
sa
.
Integer
),
sa
.
Column
(
'
num
'
,
sa
.
Integer
,
primary_key
=
True
,
autoincrement
=
False
),
sa
.
Column
(
'
txs
'
,
SMALLINT
(
unsigned
=
True
),
server_default
=
'
0
'
,
nullable
=
False
),
sa
.
Column
(
'
prev
'
,
sa
.
Integer
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
txs
'
,
SMALLINT
(
unsigned
=
True
),
server_default
=
'
0
'
,
nullable
=
False
),
sa
.
UniqueConstraint
(
'
prev
'
,
name
=
'
hive_blocks_ux1
'
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
prev
'
],
[
'
hive_blocks.num
'
],
name
=
'
hive_blocks_fk1
'
),
sa
.
UniqueConstraint
(
'
prev
'
,
name
=
'
hive_blocks_ux1
'
),
mysql_engine
=
'
InnoDB
'
,
sa
.
ForeignKeyConstraint
([
'
prev
'
],
[
'
hive_blocks.num
'
],
name
=
'
hive_blocks_fk1
'
),
mysql_default_charset
=
'
utf8mb4
'
)
mysql_engine
=
'
InnoDB
'
,
mysql_default_charset
=
'
utf8mb4
'
hive_accounts
=
sa
.
Table
(
'
hive_accounts
'
,
metadata
,
)
sa
.
Column
(
'
id
'
,
sa
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'
name
'
,
sa
.
String
(
16
),
nullable
=
False
),
hive_accounts
=
sa
.
Table
(
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
'
hive_accounts
'
,
metadata
,
sa
.
UniqueConstraint
(
'
name
'
,
name
=
'
hive_accounts_ux1
'
),
sa
.
Column
(
'
id
'
,
sa
.
Integer
,
primary_key
=
True
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
name
'
,
sa
.
String
(
16
),
nullable
=
False
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
UniqueConstraint
(
'
name
'
,
name
=
'
hive_accounts_ux1
'
),
mysql_engine
=
'
InnoDB
'
,
mysql_default_charset
=
'
utf8mb4
'
)
# The column 'permlink' is CHAR(190) instead of CHAR(255) since the latter
# The column 'permlink' is CHAR(190) instead of CHAR(255) since the latter
# will give error: (1071, 'Specified key was too long; max key length is 767 bytes')
# will give error: (1071, 'Specified key was too long; max key length is 767 bytes')
hive_posts
=
sa
.
Table
(
'
hive_posts
'
,
metadata
,
hive_posts
=
sa
.
Table
(
sa
.
Column
(
'
id
'
,
sa
.
Integer
,
primary_key
=
True
),
'
hive_posts
'
,
metadata
,
sa
.
Column
(
'
parent_id
'
,
sa
.
Integer
),
sa
.
Column
(
'
id
'
,
sa
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'
author
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
parent_id
'
,
sa
.
Integer
),
sa
.
Column
(
'
permlink
'
,
CHAR
(
255
,
ascii
=
True
),
nullable
=
False
),
sa
.
Column
(
'
author
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
community
'
,
CHAR
(
16
)),
sa
.
Column
(
'
permlink
'
,
CHAR
(
255
,
ascii
=
True
),
nullable
=
False
),
sa
.
Column
(
'
category
'
,
CHAR
(
255
,
ascii
=
True
),
nullable
=
False
),
sa
.
Column
(
'
community
'
,
CHAR
(
16
)),
sa
.
Column
(
'
depth
'
,
SMALLINT
(
unsigned
=
True
),
nullable
=
False
),
sa
.
Column
(
'
category
'
,
CHAR
(
255
,
ascii
=
True
),
nullable
=
False
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
depth
'
,
SMALLINT
(
unsigned
=
True
),
nullable
=
False
),
sa
.
Column
(
'
is_deleted
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
is_pinned
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
is_deleted
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
is_muted
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
is_pinned
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
ForeignKeyConstraint
([
'
author
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_posts_fk1
'
),
sa
.
Column
(
'
is_muted
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
ForeignKeyConstraint
([
'
community
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_posts_fk2
'
),
sa
.
ForeignKeyConstraint
([
'
author
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_posts_fk1
'
),
sa
.
ForeignKeyConstraint
([
'
parent_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_posts_fk3
'
),
sa
.
ForeignKeyConstraint
([
'
community
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_posts_fk2
'
),
sa
.
UniqueConstraint
(
'
author
'
,
'
permlink
'
,
name
=
'
hive_posts_ux1
'
),
sa
.
ForeignKeyConstraint
([
'
parent_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_posts_fk3
'
),
sa
.
Index
(
'
hive_posts_ix1
'
,
'
parent_id
'
),
sa
.
UniqueConstraint
(
'
author
'
,
'
permlink
'
,
name
=
'
hive_posts_ux1
'
),
sa
.
Index
(
'
hive_posts_ix2
'
,
'
is_deleted
'
),
sa
.
Index
(
'
hive_posts_ix1
'
,
'
parent_id
'
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Index
(
'
hive_posts_ix2
'
,
'
is_deleted
'
),
mysql_default_charset
=
'
utf8mb4
'
)
mysql_engine
=
'
InnoDB
'
,
mysql_default_charset
=
'
utf8mb4
'
hive_follows
=
sa
.
Table
(
'
hive_follows
'
,
metadata
,
)
sa
.
Column
(
'
follower
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
following
'
,
CHAR
(
16
),
nullable
=
False
),
hive_follows
=
sa
.
Table
(
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
'
hive_follows
'
,
metadata
,
sa
.
ForeignKeyConstraint
([
'
follower
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_follows_fk1
'
),
sa
.
Column
(
'
follower
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
following
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_follows_fk2
'
),
sa
.
Column
(
'
following
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
UniqueConstraint
(
'
follower
'
,
'
following
'
,
name
=
'
hive_follows_ux1
'
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
mysql_engine
=
'
InnoDB
'
,
sa
.
ForeignKeyConstraint
([
'
follower
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_follows_fk1
'
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
ForeignKeyConstraint
([
'
following
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_follows_fk2
'
),
sa
.
UniqueConstraint
(
'
follower
'
,
'
following
'
,
name
=
'
hive_follows_ux1
'
),
hive_reblogs
=
sa
.
Table
(
'
hive_reblogs
'
,
metadata
,
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
mysql_default_charset
=
'
utf8mb4
'
sa
.
Column
(
'
post_id
'
,
sa
.
Integer
,
nullable
=
False
),
)
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_reblogs_fk1
'
),
hive_reblogs
=
sa
.
Table
(
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_reblogs_fk2
'
),
'
hive_reblogs
'
,
metadata
,
sa
.
UniqueConstraint
(
'
account
'
,
'
post_id
'
,
name
=
'
hive_reblogs_ux1
'
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Index
(
'
hive_reblogs_ix1
'
,
'
post_id
'
,
'
account
'
,
'
created_at
'
),
sa
.
Column
(
'
post_id
'
,
sa
.
Integer
,
nullable
=
False
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_reblogs_fk1
'
),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_reblogs_fk2
'
),
hive_communities
=
sa
.
Table
(
'
hive_communities
'
,
metadata
,
sa
.
UniqueConstraint
(
'
account
'
,
'
post_id
'
,
name
=
'
hive_reblogs_ux1
'
),
sa
.
Column
(
'
name
'
,
CHAR
(
16
),
primary_key
=
True
),
sa
.
Index
(
'
hive_reblogs_ix1
'
,
'
post_id
'
,
'
account
'
,
'
created_at
'
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
32
),
nullable
=
False
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
about
'
,
sa
.
String
(
255
),
nullable
=
False
,
server_default
=
''
),
mysql_default_charset
=
'
utf8mb4
'
sa
.
Column
(
'
description
'
,
sa
.
String
(
5000
),
nullable
=
False
,
server_default
=
''
),
)
sa
.
Column
(
'
lang
'
,
CHAR
(
2
),
nullable
=
False
,
server_default
=
'
en
'
),
sa
.
Column
(
'
settings
'
,
TINYTEXT
,
nullable
=
False
),
hive_communities
=
sa
.
Table
(
sa
.
Column
(
'
type_id
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
'
hive_communities
'
,
metadata
,
sa
.
Column
(
'
is_nsfw
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
name
'
,
CHAR
(
16
),
primary_key
=
True
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
32
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
name
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_communities_fk1
'
),
sa
.
Column
(
'
about
'
,
sa
.
String
(
255
),
nullable
=
False
,
server_default
=
''
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
description
'
,
sa
.
String
(
5000
),
nullable
=
False
,
server_default
=
''
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
Column
(
'
lang
'
,
CHAR
(
2
),
nullable
=
False
,
server_default
=
'
en
'
),
sa
.
Column
(
'
settings
'
,
TINYTEXT
,
nullable
=
False
),
hive_members
=
sa
.
Table
(
'
hive_members
'
,
metadata
,
sa
.
Column
(
'
type_id
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
community
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
is_nsfw
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
is_admin
'
,
TINYINT
(
1
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
name
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_communities_fk1
'
),
sa
.
Column
(
'
is_mod
'
,
TINYINT
(
1
),
nullable
=
False
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
is_approved
'
,
TINYINT
(
1
),
nullable
=
False
),
mysql_default_charset
=
'
utf8mb4
'
sa
.
Column
(
'
is_muted
'
,
TINYINT
(
1
),
nullable
=
False
),
)
sa
.
Column
(
'
title
'
,
sa
.
String
(
255
),
nullable
=
False
,
server_default
=
''
),
sa
.
ForeignKeyConstraint
([
'
community
'
],
[
'
hive_communities.name
'
],
name
=
'
hive_members_fk1
'
),
hive_members
=
sa
.
Table
(
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_members_fk2
'
),
'
hive_members
'
,
metadata
,
sa
.
UniqueConstraint
(
'
community
'
,
'
account
'
,
name
=
'
hive_members_ux1
'
),
sa
.
Column
(
'
community
'
,
CHAR
(
16
),
nullable
=
False
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
Column
(
'
is_admin
'
,
TINYINT
(
1
),
nullable
=
False
),
sa
.
Column
(
'
is_mod
'
,
TINYINT
(
1
),
nullable
=
False
),
hive_flags
=
sa
.
Table
(
'
hive_flags
'
,
metadata
,
sa
.
Column
(
'
is_approved
'
,
TINYINT
(
1
),
nullable
=
False
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
is_muted
'
,
TINYINT
(
1
),
nullable
=
False
),
sa
.
Column
(
'
post_id
'
,
sa
.
Integer
,
nullable
=
False
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
255
),
nullable
=
False
,
server_default
=
''
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
community
'
],
[
'
hive_communities.name
'
],
name
=
'
hive_members_fk1
'
),
sa
.
Column
(
'
notes
'
,
sa
.
String
(
255
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_members_fk2
'
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_flags_fk1
'
),
sa
.
UniqueConstraint
(
'
community
'
,
'
account
'
,
name
=
'
hive_members_ux1
'
),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_flags_fk2
'
),
mysql_engine
=
'
InnoDB
'
,
sa
.
UniqueConstraint
(
'
account
'
,
'
post_id
'
,
name
=
'
hive_flags_ux1
'
),
mysql_default_charset
=
'
utf8mb4
'
mysql_engine
=
'
InnoDB
'
,
)
mysql_default_charset
=
'
utf8mb4
'
)
hive_flags
=
sa
.
Table
(
hive_modlog
=
sa
.
Table
(
'
hive_modlog
'
,
metadata
,
'
hive_flags
'
,
metadata
,
sa
.
Column
(
'
id
'
,
sa
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
community
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
post_id
'
,
sa
.
Integer
,
nullable
=
False
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
action
'
,
sa
.
String
(
32
),
nullable
=
False
),
sa
.
Column
(
'
notes
'
,
sa
.
String
(
255
),
nullable
=
False
),
sa
.
Column
(
'
params
'
,
sa
.
String
(
1000
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_flags_fk1
'
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_flags_fk2
'
),
sa
.
ForeignKeyConstraint
([
'
community
'
],
[
'
hive_communities.name
'
],
name
=
'
hive_modlog_fk1
'
),
sa
.
UniqueConstraint
(
'
account
'
,
'
post_id
'
,
name
=
'
hive_flags_ux1
'
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_modlog_fk2
'
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Index
(
'
hive_modlog_ix1
'
,
'
community
'
,
'
created_at
'
),
mysql_default_charset
=
'
utf8mb4
'
mysql_engine
=
'
InnoDB
'
,
)
mysql_default_charset
=
'
utf8mb4
'
)
hive_modlog
=
sa
.
Table
(
hive_posts_cache
=
sa
.
Table
(
'
hive_posts_cache
'
,
metadata
,
'
hive_modlog
'
,
metadata
,
sa
.
Column
(
'
post_id
'
,
sa
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'
id
'
,
sa
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
255
),
nullable
=
False
),
sa
.
Column
(
'
community
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
preview
'
,
sa
.
String
(
1024
),
nullable
=
False
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
nullable
=
False
),
sa
.
Column
(
'
img_url
'
,
sa
.
String
(
1024
),
nullable
=
False
),
sa
.
Column
(
'
action
'
,
sa
.
String
(
32
),
nullable
=
False
),
sa
.
Column
(
'
payout
'
,
sa
.
types
.
DECIMAL
(
10
,
3
),
nullable
=
False
),
sa
.
Column
(
'
params
'
,
sa
.
String
(
1000
),
nullable
=
False
),
sa
.
Column
(
'
promoted
'
,
sa
.
types
.
DECIMAL
(
10
,
3
),
nullable
=
False
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
community
'
],
[
'
hive_communities.name
'
],
name
=
'
hive_modlog_fk1
'
),
sa
.
Column
(
'
payout_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_modlog_fk2
'
),
sa
.
Column
(
'
updated_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Index
(
'
hive_modlog_ix1
'
,
'
community
'
,
'
created_at
'
),
sa
.
Column
(
'
is_nsfw
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
children
'
,
sa
.
Integer
,
nullable
=
False
,
server_default
=
'
0
'
),
mysql_default_charset
=
'
utf8mb4
'
sa
.
Column
(
'
rshares
'
,
sa
.
BigInteger
,
nullable
=
False
),
)
sa
.
Column
(
'
sc_trend
'
,
DOUBLE
,
nullable
=
False
),
sa
.
Column
(
'
sc_hot
'
,
DOUBLE
,
nullable
=
False
),
hive_posts_cache
=
sa
.
Table
(
sa
.
Column
(
'
body
'
,
sa
.
Text
),
'
hive_posts_cache
'
,
metadata
,
sa
.
Column
(
'
votes
'
,
sa
.
Text
),
sa
.
Column
(
'
post_id
'
,
sa
.
Integer
,
primary_key
=
True
),
sa
.
Column
(
'
json
'
,
sa
.
Text
),
sa
.
Column
(
'
title
'
,
sa
.
String
(
255
),
nullable
=
False
),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_posts_cache_fk1
'
),
sa
.
Column
(
'
preview
'
,
sa
.
String
(
1024
),
nullable
=
False
),
sa
.
Index
(
'
hive_posts_cache_ix1
'
,
'
payout
'
),
sa
.
Column
(
'
img_url
'
,
sa
.
String
(
1024
),
nullable
=
False
),
sa
.
Index
(
'
hive_posts_cache_ix2
'
,
'
promoted
'
),
sa
.
Column
(
'
payout
'
,
sa
.
types
.
DECIMAL
(
10
,
3
),
nullable
=
False
),
sa
.
Index
(
'
hive_posts_cache_ix3
'
,
'
payout_at
'
),
sa
.
Column
(
'
promoted
'
,
sa
.
types
.
DECIMAL
(
10
,
3
),
nullable
=
False
),
sa
.
Index
(
'
hive_posts_cache_ix4
'
,
'
updated_at
'
),
sa
.
Column
(
'
created_at
'
,
sa
.
DateTime
,
nullable
=
False
),
sa
.
Index
(
'
hive_posts_cache_ix5
'
,
'
rshares
'
),
sa
.
Column
(
'
payout_at
'
,
sa
.
DateTime
,
nullable
=
False
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Column
(
'
updated_at
'
,
sa
.
DateTime
,
nullable
=
False
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
Column
(
'
is_nsfw
'
,
TINYINT
(
1
),
nullable
=
False
,
server_default
=
'
0
'
),
sa
.
Column
(
'
children
'
,
sa
.
Integer
,
nullable
=
False
,
server_default
=
'
0
'
),
hive_accounts_cache
=
sa
.
Table
(
'
hive_accounts_cache
'
,
metadata
,
sa
.
Column
(
'
rshares
'
,
sa
.
BigInteger
,
nullable
=
False
),
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
primary_key
=
True
),
sa
.
Column
(
'
sc_trend
'
,
DOUBLE
,
nullable
=
False
),
sa
.
Column
(
'
reputation
'
,
sa
.
Float
,
nullable
=
False
,
server_default
=
'
25
'
),
sa
.
Column
(
'
sc_hot
'
,
DOUBLE
,
nullable
=
False
),
sa
.
Column
(
'
name
'
,
sa
.
String
(
20
)),
sa
.
Column
(
'
body
'
,
sa
.
Text
),
sa
.
Column
(
'
about
'
,
sa
.
String
(
160
)),
sa
.
Column
(
'
votes
'
,
sa
.
Text
),
sa
.
Column
(
'
location
'
,
sa
.
String
(
30
)),
sa
.
Column
(
'
json
'
,
sa
.
Text
),
sa
.
Column
(
'
url
'
,
sa
.
String
(
100
)),
sa
.
ForeignKeyConstraint
([
'
post_id
'
],
[
'
hive_posts.id
'
],
name
=
'
hive_posts_cache_fk1
'
),
sa
.
Column
(
'
img_url
'
,
sa
.
String
(
1024
)),
sa
.
Index
(
'
hive_posts_cache_ix1
'
,
'
payout
'
),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
sa
.
Index
(
'
hive_posts_cache_ix2
'
,
'
promoted
'
),
name
=
'
hive_accounts_cache_fk1
'
),
sa
.
Index
(
'
hive_posts_cache_ix3
'
,
'
payout_at
'
),
mysql_engine
=
'
InnoDB
'
,
sa
.
Index
(
'
hive_posts_cache_ix4
'
,
'
updated_at
'
),
mysql_default_charset
=
'
utf8mb4
'
)
sa
.
Index
(
'
hive_posts_cache_ix5
'
,
'
rshares
'
),
mysql_engine
=
'
InnoDB
'
,
mysql_default_charset
=
'
utf8mb4
'
)
hive_accounts_cache
=
sa
.
Table
(
'
hive_accounts_cache
'
,
metadata
,
sa
.
Column
(
'
account
'
,
CHAR
(
16
),
primary_key
=
True
),
sa
.
Column
(
'
reputation
'
,
sa
.
Float
,
nullable
=
False
,
server_default
=
'
25
'
),
sa
.
Column
(
'
name
'
,
sa
.
String
(
20
)),
sa
.
Column
(
'
about
'
,
sa
.
String
(
160
)),
sa
.
Column
(
'
location
'
,
sa
.
String
(
30
)),
sa
.
Column
(
'
url
'
,
sa
.
String
(
100
)),
sa
.
Column
(
'
img_url
'
,
sa
.
String
(
1024
)),
sa
.
ForeignKeyConstraint
([
'
account
'
],
[
'
hive_accounts.name
'
],
name
=
'
hive_accounts_cache_fk1
'
),
mysql_engine
=
'
InnoDB
'
,
mysql_default_charset
=
'
utf8mb4
'
)
_url
=
'
mysql://root:root_password@mysql:3306/testdb
'
_url
=
'
mysql://root:root_password@mysql:3306/testdb
'
_url
=
os
.
environ
.
get
(
'
DATABASE_URL
'
,
_url
)
_url
=
os
.
environ
.
get
(
'
DATABASE_URL
'
,
_url
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment