Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
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
ops
jumpserver
Commits
cd6bb848
Commit
cd6bb848
authored
Feb 28, 2019
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Update] Squash table
parent
34040fcd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
559 additions
and
0 deletions
+559
-0
0002_auto_20180105_1807_squashed_0009_auto_20180307_1212.py
...02_auto_20180105_1807_squashed_0009_auto_20180307_1212.py
+158
-0
0010_auto_20180307_1749_squashed_0019_auto_20180816_1320.py
...10_auto_20180307_1749_squashed_0019_auto_20180816_1320.py
+0
-0
0002_auto_20171228_0025_squashed_0009_auto_20180903_1132.py
...02_auto_20171228_0025_squashed_0009_auto_20180903_1132.py
+159
-0
0002_auto_20171228_0025_squashed_0009_auto_20180326_0957.py
...02_auto_20171228_0025_squashed_0009_auto_20180326_0957.py
+84
-0
0002_auto_20171225_1157_squashed_0009_auto_20180517_1537.py
...02_auto_20171225_1157_squashed_0009_auto_20180517_1537.py
+81
-0
0010_auto_20180606_1505_squashed_0018_auto_20190107_1912.py
...10_auto_20180606_1505_squashed_0018_auto_20190107_1912.py
+77
-0
No files found.
apps/assets/migrations/0002_auto_20180105_1807_squashed_0009_auto_20180307_1212.py
0 → 100644
View file @
cd6bb848
# Generated by Django 2.1.7 on 2019-02-28 10:16
import
assets.models.asset
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
uuid
class
Migration
(
migrations
.
Migration
):
replaces
=
[(
'assets'
,
'0002_auto_20180105_1807'
),
(
'assets'
,
'0003_auto_20180109_2331'
),
(
'assets'
,
'0004_auto_20180125_1218'
),
(
'assets'
,
'0005_auto_20180126_1637'
),
(
'assets'
,
'0006_auto_20180130_1502'
),
(
'assets'
,
'0007_auto_20180225_1815'
),
(
'assets'
,
'0008_auto_20180306_1804'
),
(
'assets'
,
'0009_auto_20180307_1212'
)]
dependencies
=
[
(
'assets'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterModelOptions
(
name
=
'adminuser'
,
options
=
{
'ordering'
:
[
'name'
],
'verbose_name'
:
'Admin user'
},
),
migrations
.
AlterModelOptions
(
name
=
'asset'
,
options
=
{
'verbose_name'
:
'Asset'
},
),
migrations
.
AlterModelOptions
(
name
=
'assetgroup'
,
options
=
{
'ordering'
:
[
'name'
],
'verbose_name'
:
'Asset group'
},
),
migrations
.
AlterModelOptions
(
name
=
'cluster'
,
options
=
{
'ordering'
:
[
'name'
],
'verbose_name'
:
'Cluster'
},
),
migrations
.
AlterModelOptions
(
name
=
'systemuser'
,
options
=
{
'ordering'
:
[
'name'
],
'verbose_name'
:
'System user'
},
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'cluster'
,
),
migrations
.
AlterField
(
model_name
=
'assetgroup'
,
name
=
'created_by'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
32
,
null
=
True
,
verbose_name
=
'Created by'
),
),
migrations
.
CreateModel
(
name
=
'Label'
,
fields
=
[
(
'id'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
,
serialize
=
False
)),
(
'name'
,
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Name'
)),
(
'value'
,
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Value'
)),
(
'category'
,
models
.
CharField
(
choices
=
[(
'S'
,
'System'
),
(
'U'
,
'User'
)],
default
=
'U'
,
max_length
=
128
,
verbose_name
=
'Category'
)),
(
'is_active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'Is active'
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
null
=
True
,
verbose_name
=
'Comment'
)),
(
'date_created'
,
models
.
DateTimeField
(
auto_now_add
=
True
,
null
=
True
,
verbose_name
=
'Date created'
)),
],
options
=
{
'db_table'
:
'assets_label'
,
},
),
migrations
.
AlterUniqueTogether
(
name
=
'label'
,
unique_together
=
{(
'name'
,
'value'
)},
),
migrations
.
AddField
(
model_name
=
'asset'
,
name
=
'labels'
,
field
=
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'assets'
,
to
=
'assets.Label'
,
verbose_name
=
'Labels'
),
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'cabinet_no'
,
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'cabinet_pos'
,
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'env'
,
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'remote_card_ip'
,
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'status'
,
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'type'
,
),
migrations
.
CreateModel
(
name
=
'Node'
,
fields
=
[
(
'id'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
,
serialize
=
False
)),
(
'key'
,
models
.
CharField
(
max_length
=
64
,
unique
=
True
,
verbose_name
=
'Key'
)),
(
'value'
,
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Value'
)),
(
'child_mark'
,
models
.
IntegerField
(
default
=
0
)),
(
'date_create'
,
models
.
DateTimeField
(
auto_now_add
=
True
)),
],
),
migrations
.
RemoveField
(
model_name
=
'asset'
,
name
=
'groups'
,
),
migrations
.
RemoveField
(
model_name
=
'systemuser'
,
name
=
'cluster'
,
),
migrations
.
AlterField
(
model_name
=
'asset'
,
name
=
'admin_user'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
PROTECT
,
to
=
'assets.AdminUser'
,
verbose_name
=
'Admin user'
),
),
migrations
.
AlterField
(
model_name
=
'systemuser'
,
name
=
'protocol'
,
field
=
models
.
CharField
(
choices
=
[(
'ssh'
,
'ssh'
),
(
'rdp'
,
'rdp'
)],
default
=
'ssh'
,
max_length
=
16
,
verbose_name
=
'Protocol'
),
),
migrations
.
AddField
(
model_name
=
'asset'
,
name
=
'nodes'
,
field
=
models
.
ManyToManyField
(
default
=
assets
.
models
.
asset
.
default_node
,
related_name
=
'assets'
,
to
=
'assets.Node'
,
verbose_name
=
'Nodes'
),
),
migrations
.
AddField
(
model_name
=
'systemuser'
,
name
=
'nodes'
,
field
=
models
.
ManyToManyField
(
blank
=
True
,
to
=
'assets.Node'
,
verbose_name
=
'Nodes'
),
),
migrations
.
AlterField
(
model_name
=
'adminuser'
,
name
=
'created_by'
,
field
=
models
.
CharField
(
max_length
=
128
,
null
=
True
,
verbose_name
=
'Created by'
),
),
migrations
.
AlterField
(
model_name
=
'adminuser'
,
name
=
'username'
,
field
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Username'
),
),
migrations
.
AlterField
(
model_name
=
'asset'
,
name
=
'platform'
,
field
=
models
.
CharField
(
choices
=
[(
'Linux'
,
'Linux'
),
(
'Unix'
,
'Unix'
),
(
'MacOS'
,
'MacOS'
),
(
'BSD'
,
'BSD'
),
(
'Windows'
,
'Windows'
),
(
'Other'
,
'Other'
)],
default
=
'Linux'
,
max_length
=
128
,
verbose_name
=
'Platform'
),
),
migrations
.
AlterField
(
model_name
=
'systemuser'
,
name
=
'created_by'
,
field
=
models
.
CharField
(
max_length
=
128
,
null
=
True
,
verbose_name
=
'Created by'
),
),
migrations
.
AlterField
(
model_name
=
'systemuser'
,
name
=
'username'
,
field
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Username'
),
),
]
apps/assets/migrations/0010_auto_20180307_1749_squashed_0019_auto_20180816_1320.py
0 → 100644
View file @
cd6bb848
This diff is collapsed.
Click to expand it.
apps/perms/migrations/0002_auto_20171228_0025_squashed_0009_auto_20180903_1132.py
0 → 100644
View file @
cd6bb848
# Generated by Django 2.1.7 on 2019-02-28 10:21
import
common.utils.django
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
django.utils.timezone
import
uuid
# Functions from the following migrations need manual copying.
# Move them and any dependencies into this file, then update the
# RunPython operations to refer to the local versions:
# perms.migrations.0005_migrate_data_20180411_1144
def
migrate_node_permissions
(
apps
,
schema_editor
):
node_perm_model
=
apps
.
get_model
(
"perms"
,
"NodePermission"
)
asset_perm_model
=
apps
.
get_model
(
"perms"
,
"AssetPermission"
)
db_alias
=
schema_editor
.
connection
.
alias
for
old
in
node_perm_model
.
objects
.
using
(
db_alias
)
.
all
():
perm
=
asset_perm_model
.
objects
.
using
(
db_alias
)
.
create
(
name
=
"{}-{}-{}"
.
format
(
old
.
node
.
value
,
old
.
user_group
.
name
,
old
.
system_user
.
name
),
is_active
=
old
.
is_active
,
date_expired
=
old
.
date_expired
,
created_by
=
old
.
date_expired
,
date_created
=
old
.
date_created
,
comment
=
old
.
comment
,
)
perm
.
user_groups
.
add
(
old
.
user_group
)
perm
.
nodes
.
add
(
old
.
node
)
perm
.
system_users
.
add
(
old
.
system_user
)
def
migrate_system_assets_relation
(
apps
,
schema_editor
):
system_user_model
=
apps
.
get_model
(
"assets"
,
"SystemUser"
)
db_alias
=
schema_editor
.
connection
.
alias
for
s
in
system_user_model
.
objects
.
using
(
db_alias
)
.
all
():
nodes
=
list
(
s
.
nodes
.
all
())
s
.
nodes
.
set
([])
s
.
nodes
.
set
(
nodes
)
class
Migration
(
migrations
.
Migration
):
replaces
=
[(
'perms'
,
'0002_auto_20171228_0025'
),
(
'perms'
,
'0003_auto_20180225_1815'
),
(
'perms'
,
'0004_auto_20180411_1135'
),
(
'perms'
,
'0005_migrate_data_20180411_1144'
),
(
'perms'
,
'0006_auto_20180606_1505'
),
(
'perms'
,
'0007_auto_20180807_1116'
),
(
'perms'
,
'0008_auto_20180816_1652'
),
(
'perms'
,
'0009_auto_20180903_1132'
)]
dependencies
=
[
(
'users'
,
'0002_auto_20171225_1157'
),
(
'assets'
,
'0007_auto_20180225_1815'
),
(
'assets'
,
'0013_auto_20180411_1135'
),
(
'users'
,
'0004_auto_20180125_1218'
),
(
'perms'
,
'0001_initial'
),
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'assetpermission'
,
name
=
'user_groups'
,
field
=
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'asset_permissions'
,
to
=
'users.UserGroup'
,
verbose_name
=
'User group'
),
),
migrations
.
AddField
(
model_name
=
'assetpermission'
,
name
=
'users'
,
field
=
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'asset_permissions'
,
to
=
settings
.
AUTH_USER_MODEL
,
verbose_name
=
'User'
),
),
migrations
.
CreateModel
(
name
=
'NodePermission'
,
fields
=
[
(
'id'
,
models
.
UUIDField
(
default
=
uuid
.
uuid4
,
primary_key
=
True
,
serialize
=
False
)),
(
'is_active'
,
models
.
BooleanField
(
default
=
True
,
verbose_name
=
'Active'
)),
(
'date_expired'
,
models
.
DateTimeField
(
default
=
common
.
utils
.
django
.
date_expired_default
,
verbose_name
=
'Date expired'
)),
(
'created_by'
,
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
verbose_name
=
'Created by'
)),
(
'date_created'
,
models
.
DateTimeField
(
auto_now_add
=
True
,
verbose_name
=
'Date created'
)),
(
'comment'
,
models
.
TextField
(
blank
=
True
,
verbose_name
=
'Comment'
)),
(
'node'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'assets.Node'
,
verbose_name
=
'Node'
)),
(
'system_user'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'assets.SystemUser'
,
verbose_name
=
'System user'
)),
(
'user_group'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'users.UserGroup'
,
verbose_name
=
'User group'
)),
],
options
=
{
'verbose_name'
:
'Asset permission'
,
},
),
migrations
.
AlterUniqueTogether
(
name
=
'nodepermission'
,
unique_together
=
{(
'node'
,
'user_group'
,
'system_user'
)},
),
migrations
.
RemoveField
(
model_name
=
'assetpermission'
,
name
=
'asset_groups'
,
),
migrations
.
AddField
(
model_name
=
'assetpermission'
,
name
=
'date_start'
,
field
=
models
.
DateTimeField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'Date start'
),
),
migrations
.
AddField
(
model_name
=
'assetpermission'
,
name
=
'nodes'
,
field
=
models
.
ManyToManyField
(
blank
=
True
,
related_name
=
'granted_by_permissions'
,
to
=
'assets.Node'
,
verbose_name
=
'Nodes'
),
),
migrations
.
RunPython
(
code
=
migrate_node_permissions
,
),
migrations
.
RunPython
(
code
=
migrate_system_assets_relation
,
),
migrations
.
AlterField
(
model_name
=
'assetpermission'
,
name
=
'date_expired'
,
field
=
models
.
DateTimeField
(
db_index
=
True
,
default
=
common
.
utils
.
django
.
date_expired_default
,
verbose_name
=
'Date expired'
),
),
migrations
.
AlterField
(
model_name
=
'assetpermission'
,
name
=
'date_start'
,
field
=
models
.
DateTimeField
(
db_index
=
True
,
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'Date start'
),
),
migrations
.
AddField
(
model_name
=
'assetpermission'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
None
,
max_length
=
36
,
null
=
True
),
),
migrations
.
AddField
(
model_name
=
'nodepermission'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
None
,
max_length
=
36
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'assetpermission'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Name'
),
),
migrations
.
AlterUniqueTogether
(
name
=
'assetpermission'
,
unique_together
=
{(
'org_id'
,
'name'
)},
),
migrations
.
AlterUniqueTogether
(
name
=
'nodepermission'
,
unique_together
=
set
(),
),
migrations
.
AlterField
(
model_name
=
'assetpermission'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterField
(
model_name
=
'nodepermission'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AlterModelOptions
(
name
=
'assetpermission'
,
options
=
{
'verbose_name'
:
'Asset permission'
},
),
]
apps/terminal/migrations/0002_auto_20171228_0025_squashed_0009_auto_20180326_0957.py
0 → 100644
View file @
cd6bb848
# Generated by Django 2.1.7 on 2019-02-28 10:23
from
django.conf
import
settings
from
django.db
import
migrations
,
models
import
django.db.models.deletion
import
django.utils.timezone
class
Migration
(
migrations
.
Migration
):
replaces
=
[(
'terminal'
,
'0002_auto_20171228_0025'
),
(
'terminal'
,
'0003_auto_20171230_0308'
),
(
'terminal'
,
'0004_session_remote_addr'
),
(
'terminal'
,
'0005_auto_20180122_1154'
),
(
'terminal'
,
'0006_auto_20180123_1037'
),
(
'terminal'
,
'0007_session_date_last_active'
),
(
'terminal'
,
'0008_auto_20180307_1603'
),
(
'terminal'
,
'0009_auto_20180326_0957'
)]
dependencies
=
[
(
'terminal'
,
'0001_initial'
),
migrations
.
swappable_dependency
(
settings
.
AUTH_USER_MODEL
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'session'
,
name
=
'terminal'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'terminal.Terminal'
),
),
migrations
.
AddField
(
model_name
=
'status'
,
name
=
'terminal'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'terminal.Terminal'
),
),
migrations
.
AddField
(
model_name
=
'task'
,
name
=
'terminal'
,
field
=
models
.
ForeignKey
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
SET_NULL
,
to
=
'terminal.Terminal'
),
),
migrations
.
AddField
(
model_name
=
'terminal'
,
name
=
'user'
,
field
=
models
.
OneToOneField
(
null
=
True
,
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
related_name
=
'terminal'
,
to
=
settings
.
AUTH_USER_MODEL
,
verbose_name
=
'Application User'
),
),
migrations
.
AlterField
(
model_name
=
'terminal'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
32
,
verbose_name
=
'Name'
),
),
migrations
.
AlterField
(
model_name
=
'command'
,
name
=
'asset'
,
field
=
models
.
CharField
(
db_index
=
True
,
max_length
=
128
,
verbose_name
=
'Asset'
),
),
migrations
.
AlterField
(
model_name
=
'command'
,
name
=
'system_user'
,
field
=
models
.
CharField
(
db_index
=
True
,
max_length
=
64
,
verbose_name
=
'System user'
),
),
migrations
.
AlterField
(
model_name
=
'command'
,
name
=
'user'
,
field
=
models
.
CharField
(
db_index
=
True
,
max_length
=
64
,
verbose_name
=
'User'
),
),
migrations
.
AddField
(
model_name
=
'session'
,
name
=
'remote_addr'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
15
,
null
=
True
,
verbose_name
=
'Remote addr'
),
),
migrations
.
AddField
(
model_name
=
'terminal'
,
name
=
'command_storage'
,
field
=
models
.
CharField
(
default
=
'default'
,
max_length
=
128
,
verbose_name
=
'Command storage'
),
),
migrations
.
AddField
(
model_name
=
'terminal'
,
name
=
'replay_storage'
,
field
=
models
.
CharField
(
default
=
'default'
,
max_length
=
128
,
verbose_name
=
'Replay storage'
),
),
migrations
.
AddField
(
model_name
=
'session'
,
name
=
'date_last_active'
,
field
=
models
.
DateTimeField
(
default
=
django
.
utils
.
timezone
.
now
,
verbose_name
=
'Date last active'
),
),
migrations
.
AlterField
(
model_name
=
'session'
,
name
=
'date_start'
,
field
=
models
.
DateTimeField
(
db_index
=
True
,
verbose_name
=
'Date start'
),
),
]
apps/users/migrations/0002_auto_20171225_1157_squashed_0009_auto_20180517_1537.py
0 → 100644
View file @
cd6bb848
# Generated by Django 2.1.7 on 2019-02-28 10:19
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
replaces
=
[(
'users'
,
'0002_auto_20171225_1157'
),
(
'users'
,
'0003_auto_20180101_0046'
),
(
'users'
,
'0004_auto_20180125_1218'
),
(
'users'
,
'0005_auto_20180306_1804'
),
(
'users'
,
'0006_auto_20180411_1135'
),
(
'users'
,
'0007_auto_20180419_1036'
),
(
'users'
,
'0008_auto_20180425_1516'
),
(
'users'
,
'0009_auto_20180517_1537'
)]
dependencies
=
[
(
'users'
,
'0001_initial'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'email'
,
field
=
models
.
EmailField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
'Email'
),
),
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Name'
),
),
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'username'
,
field
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
'Username'
),
),
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'wechat'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
verbose_name
=
'Wechat'
),
),
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'is_first_login'
,
field
=
models
.
BooleanField
(
default
=
True
),
),
migrations
.
AlterField
(
model_name
=
'usergroup'
,
name
=
'created_by'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
100
,
null
=
True
),
),
migrations
.
AlterModelOptions
(
name
=
'user'
,
options
=
{
'ordering'
:
[
'username'
],
'verbose_name'
:
'User'
},
),
migrations
.
AlterModelOptions
(
name
=
'usergroup'
,
options
=
{
'ordering'
:
[
'name'
],
'verbose_name'
:
'User group'
},
),
migrations
.
RenameField
(
model_name
=
'user'
,
old_name
=
'secret_key_otp'
,
new_name
=
'otp_secret_key'
,
),
migrations
.
RemoveField
(
model_name
=
'user'
,
name
=
'enable_otp'
,
),
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'otp_level'
,
field
=
models
.
SmallIntegerField
(
choices
=
[(
0
,
'Disable'
),
(
1
,
'Enable'
),
(
2
,
'Force enable'
)],
default
=
0
,
verbose_name
=
'MFA'
),
),
migrations
.
RemoveField
(
model_name
=
'user'
,
name
=
'otp_secret_key'
,
),
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'_otp_secret_key'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
128
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'usergroup'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
128
,
unique
=
True
,
verbose_name
=
'Name'
),
),
]
apps/users/migrations/0010_auto_20180606_1505_squashed_0018_auto_20190107_1912.py
0 → 100644
View file @
cd6bb848
# Generated by Django 2.1.7 on 2019-02-28 10:20
import
common.utils.django
from
django.db
import
migrations
,
models
# Functions from the following migrations need manual copying.
# Move them and any dependencies into this file, then update the
# RunPython operations to refer to the local versions:
# users.migrations.0010_auto_20180606_1505
def
remove_deleted_group
(
apps
,
schema_editor
):
db_alias
=
schema_editor
.
connection
.
alias
group_model
=
apps
.
get_model
(
"users"
,
"UserGroup"
)
group_model
.
objects
.
using
(
db_alias
)
.
filter
(
is_discard
=
True
)
.
delete
()
class
Migration
(
migrations
.
Migration
):
replaces
=
[(
'users'
,
'0010_auto_20180606_1505'
),
(
'users'
,
'0011_user_source'
),
(
'users'
,
'0012_auto_20180710_1641'
),
(
'users'
,
'0013_auto_20180807_1116'
),
(
'users'
,
'0014_auto_20180816_1652'
),
(
'users'
,
'0015_auto_20181105_1112'
),
(
'users'
,
'0016_auto_20181109_1505'
),
(
'users'
,
'0017_auto_20181123_1113'
),
(
'users'
,
'0018_auto_20190107_1912'
)]
dependencies
=
[
(
'users'
,
'0009_auto_20180517_1537'
),
]
operations
=
[
migrations
.
RunPython
(
code
=
remove_deleted_group
,
),
migrations
.
RemoveField
(
model_name
=
'usergroup'
,
name
=
'discard_time'
,
),
migrations
.
RemoveField
(
model_name
=
'usergroup'
,
name
=
'is_discard'
,
),
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'date_expired'
,
field
=
models
.
DateTimeField
(
blank
=
True
,
db_index
=
True
,
default
=
common
.
utils
.
django
.
date_expired_default
,
null
=
True
,
verbose_name
=
'Date expired'
),
),
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'source'
,
field
=
models
.
CharField
(
choices
=
[(
'local'
,
'Local'
),
(
'ldap'
,
'LDAP/AD'
),
(
'openid'
,
'OpenID'
),
(
'radius'
,
'Radius'
)],
default
=
'local'
,
max_length
=
30
,
verbose_name
=
'Source'
),
),
migrations
.
AddField
(
model_name
=
'usergroup'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
default
=
None
,
max_length
=
36
,
null
=
True
),
),
migrations
.
AlterField
(
model_name
=
'user'
,
name
=
'last_name'
,
field
=
models
.
CharField
(
blank
=
True
,
max_length
=
150
,
verbose_name
=
'last name'
),
),
migrations
.
AlterField
(
model_name
=
'usergroup'
,
name
=
'name'
,
field
=
models
.
CharField
(
max_length
=
128
,
verbose_name
=
'Name'
),
),
migrations
.
AlterUniqueTogether
(
name
=
'usergroup'
,
unique_together
=
{(
'org_id'
,
'name'
)},
),
migrations
.
AlterField
(
model_name
=
'usergroup'
,
name
=
'org_id'
,
field
=
models
.
CharField
(
blank
=
True
,
db_index
=
True
,
default
=
''
,
max_length
=
36
,
verbose_name
=
'Organization'
),
),
migrations
.
AddField
(
model_name
=
'user'
,
name
=
'date_password_last_updated'
,
field
=
models
.
DateTimeField
(
auto_now_add
=
True
,
null
=
True
,
verbose_name
=
'Date password last updated'
),
),
]
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