Implement CRUD for accounts and trades
This commit is contained in:
26
core/migrations/0007_account.py
Normal file
26
core/migrations/0007_account.py
Normal file
@@ -0,0 +1,26 @@
|
||||
# Generated by Django 4.1.2 on 2022-10-17 17:18
|
||||
|
||||
from django.conf import settings
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0006_remove_callback_market_alter_callback_timestamp_sent_and_more'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Account',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(max_length=255)),
|
||||
('exchange', models.CharField(max_length=255)),
|
||||
('api_key', models.CharField(max_length=255)),
|
||||
('api_secret', models.CharField(max_length=255)),
|
||||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
|
||||
],
|
||||
),
|
||||
]
|
||||
28
core/migrations/0008_trade.py
Normal file
28
core/migrations/0008_trade.py
Normal file
@@ -0,0 +1,28 @@
|
||||
# Generated by Django 4.1.2 on 2022-10-17 17:39
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('core', '0007_account'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Trade',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('symbol', models.CharField(max_length=255)),
|
||||
('type', models.CharField(max_length=255)),
|
||||
('amount', models.FloatField()),
|
||||
('price', models.FloatField()),
|
||||
('stop_loss', models.FloatField(blank=True, null=True)),
|
||||
('take_profit', models.FloatField(blank=True, null=True)),
|
||||
('account', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.account')),
|
||||
('hook', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='core.hook')),
|
||||
],
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user