mirror of
https://gitlab.crans.org/bde/nk20
synced 2024-11-27 02:43:01 +00:00
124 lines
5.9 KiB
Python
124 lines
5.9 KiB
Python
# Generated by Django 2.2.3 on 2019-07-16 11:53
|
|
|
|
from django.conf import settings
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
import django.utils.timezone
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
initial = True
|
|
|
|
dependencies = [
|
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
('member', '0001_initial'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name='Note',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('balance', models.IntegerField(help_text='in centimes, money credited for this instance', verbose_name='account balance')),
|
|
('is_active', models.BooleanField(default=True, help_text='Designates whether this note should be treated as active. Unselect this instead of deleting notes.', verbose_name='active')),
|
|
],
|
|
options={
|
|
'verbose_name': 'note',
|
|
'verbose_name_plural': 'notes',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Transaction',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('datetime', models.DateTimeField(default=django.utils.timezone.now, verbose_name='destination')),
|
|
('quantity', models.PositiveSmallIntegerField(verbose_name='quantity')),
|
|
('amount', models.PositiveIntegerField(verbose_name='amount')),
|
|
('transaction_type', models.CharField(max_length=31, verbose_name='type')),
|
|
('description', models.TextField(verbose_name='description')),
|
|
('valid', models.NullBooleanField(verbose_name='valid')),
|
|
('destination', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='note.Note', verbose_name='destination')),
|
|
('source', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='note.Note', verbose_name='source')),
|
|
],
|
|
options={
|
|
'verbose_name': 'transaction',
|
|
'verbose_name_plural': 'transactions',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='NoteSpecial',
|
|
fields=[
|
|
('note_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Note')),
|
|
('special_type', models.CharField(max_length=255, unique=True, verbose_name='type')),
|
|
],
|
|
options={
|
|
'verbose_name': 'special note',
|
|
'verbose_name_plural': 'special notes',
|
|
},
|
|
bases=('note.note',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='TransactionTemplate',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255, verbose_name='name')),
|
|
('amount', models.PositiveIntegerField(verbose_name='amount')),
|
|
('template_type', models.CharField(max_length=31, verbose_name='type')),
|
|
('destination', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='note.Note', verbose_name='destination')),
|
|
],
|
|
options={
|
|
'verbose_name': 'transaction template',
|
|
'verbose_name_plural': 'transaction templates',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='Alias',
|
|
fields=[
|
|
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
|
('name', models.CharField(max_length=255, unique=True, verbose_name='name')),
|
|
('note', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='note.Note')),
|
|
],
|
|
options={
|
|
'verbose_name': 'alias',
|
|
'verbose_name_plural': 'aliases',
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name='NoteUser',
|
|
fields=[
|
|
('note_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Note')),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='note', to=settings.AUTH_USER_MODEL)),
|
|
],
|
|
options={
|
|
'verbose_name': "one's note",
|
|
'verbose_name_plural': 'users note',
|
|
},
|
|
bases=('note.note',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='NoteClub',
|
|
fields=[
|
|
('note_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Note')),
|
|
('user', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='note', to='member.Club')),
|
|
],
|
|
options={
|
|
'verbose_name': 'club note',
|
|
'verbose_name_plural': 'clubs notes',
|
|
},
|
|
bases=('note.note',),
|
|
),
|
|
migrations.CreateModel(
|
|
name='MembershipTransaction',
|
|
fields=[
|
|
('transaction_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='note.Transaction')),
|
|
('membership', models.OneToOneField(on_delete=django.db.models.deletion.PROTECT, related_name='transaction', to='member.Membership')),
|
|
],
|
|
options={
|
|
'verbose_name': 'membership transaction',
|
|
'verbose_name_plural': 'membership transactions',
|
|
},
|
|
bases=('note.transaction',),
|
|
),
|
|
]
|