Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
A
alpha-mind
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dr.李
alpha-mind
Commits
96a37803
Commit
96a37803
authored
Sep 26, 2017
by
Dr.李
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update db models
parent
d18d36f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
models.py
alphamind/data/dbmodel/models.py
+4
-4
No files found.
alphamind/data/dbmodel/models.py
View file @
96a37803
...
@@ -1423,7 +1423,7 @@ class Models(Base):
...
@@ -1423,7 +1423,7 @@ class Models(Base):
model_version
=
Column
(
BigInteger
,
nullable
=
False
)
model_version
=
Column
(
BigInteger
,
nullable
=
False
)
update_time
=
Column
(
DateTime
,
nullable
=
False
)
update_time
=
Column
(
DateTime
,
nullable
=
False
)
model_desc
=
Column
(
JSONB
,
nullable
=
False
)
model_desc
=
Column
(
JSONB
,
nullable
=
False
)
is_primary
=
Column
(
Boolean
,
default
=
False
)
is_primary
=
Column
(
Boolean
)
model_id
=
Column
(
Integer
,
primary_key
=
True
,
server_default
=
text
(
"nextval('models_model_id_seq'::regclass)"
))
model_id
=
Column
(
Integer
,
primary_key
=
True
,
server_default
=
text
(
"nextval('models_model_id_seq'::regclass)"
))
...
@@ -1459,12 +1459,12 @@ class PnlLog(Base):
...
@@ -1459,12 +1459,12 @@ class PnlLog(Base):
class
PortfolioSettings
(
Base
):
class
PortfolioSettings
(
Base
):
__tablename__
=
'portfolio_settings'
__tablename__
=
'portfolio_settings'
__table_args__
=
(
__table_args__
=
(
Index
(
'portfolio_pk'
,
'trade_date'
,
'portfolio_name'
,
unique
=
True
),
Index
(
'portfolio_pk'
,
'trade_date'
,
'portfolio_name'
,
'model_id'
,
unique
=
True
),
)
)
trade_date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
trade_date
=
Column
(
DateTime
,
primary_key
=
True
,
nullable
=
False
)
portfolio_name
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
portfolio_name
=
Column
(
String
(
50
),
primary_key
=
True
,
nullable
=
False
)
model_id
=
Column
(
BigInteger
,
nullable
=
False
)
model_id
=
Column
(
BigInteger
,
primary_key
=
True
,
nullable
=
False
)
class
Positions
(
Base
):
class
Positions
(
Base
):
...
@@ -2372,5 +2372,5 @@ class Uqer(Base):
...
@@ -2372,5 +2372,5 @@ class Uqer(Base):
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
from
sqlalchemy
import
create_engine
from
sqlalchemy
import
create_engine
engine
=
create_engine
(
'postgresql+psycopg2://postgres:we083826@1
01.132.104.118
/alpha'
)
engine
=
create_engine
(
'postgresql+psycopg2://postgres:we083826@1
92.168.0.102
/alpha'
)
Base
.
metadata
.
create_all
(
engine
)
Base
.
metadata
.
create_all
(
engine
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment