Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
webomagic-auth
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Pratik Shrivastava
webomagic-auth
Commits
eee5b6cd
Commit
eee5b6cd
authored
Jul 16, 2024
by
deepdey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update user schema and orm
parent
7f84ab96
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
44 deletions
+61
-44
app/orm/user_orm.py
app/orm/user_orm.py
+9
-6
app/routes/user/user_response.py
app/routes/user/user_response.py
+9
-6
database/query.sql
database/query.sql
+31
-25
database/schema.sql
database/schema.sql
+12
-7
No files found.
app/orm/user_orm.py
View file @
eee5b6cd
...
...
@@ -15,17 +15,20 @@ class User(db.Model, CustomSerializerMixin):
)
username
=
db
.
Column
(
db
.
String
(
80
),
nullable
=
False
)
first_name
=
db
.
Column
(
db
.
String
(
80
),
nullable
=
False
)
last_name
=
db
.
Column
(
db
.
String
(
80
),
nullable
=
False
)
name
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
)
password
=
db
.
Column
(
db
.
String
(
80
),
nullable
=
False
)
phone
=
db
.
Column
(
db
.
String
(
20
),
nullable
=
False
)
organization
=
db
.
Column
(
db
.
String
(
255
),
nullable
=
False
)
gstin
=
db
.
Column
(
db
.
String
(
50
),
nullable
=
False
)
email
=
db
.
Column
(
db
.
String
(
120
),
nullable
=
False
)
gender
=
db
.
Column
(
db
.
String
(
20
),
nullable
=
False
)
active
=
db
.
Column
(
db
.
Boolean
,
default
=
True
,
nullable
=
False
)
date_of_join
=
db
.
Column
(
db
.
BigInteger
,
nullable
=
False
)
phone_number
=
db
.
Column
(
db
.
String
(
20
),
nullable
=
False
)
email_verified
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
phone_verified
=
db
.
Column
(
db
.
Boolean
,
default
=
False
,
nullable
=
False
)
status
=
db
.
Column
(
db
.
String
(
20
),
nullable
=
False
)
created_at
=
db
.
Column
(
db
.
DATETIME
,
default
=
datetime
.
now
)
updated_at
=
db
.
Column
(
db
.
DATETIME
,
onupdate
=
datetime
.
now
)
created_by
=
db
.
Column
(
db
.
BigInteger
,
db
.
ForeignKey
(
'webomagic_user.id'
))
updated_by
=
db
.
Column
(
db
.
BigInteger
,
db
.
ForeignKey
(
'webomagic_user.id'
))
is_deleted
=
db
.
Column
(
db
.
Boolean
,
default
=
False
)
user_roles
=
db
.
relationship
(
'UserRoleMap'
)
...
...
app/routes/user/user_response.py
View file @
eee5b6cd
...
...
@@ -10,18 +10,21 @@ USER_RESPONSE_MODEL: any = api.model(
{
'id'
:
fields
.
Integer
,
'username'
:
fields
.
String
,
'
first_
name'
:
fields
.
String
,
'
last_name
'
:
fields
.
String
,
'
phone
'
:
fields
.
String
,
'name'
:
fields
.
String
,
'
organization
'
:
fields
.
String
,
'
gstin
'
:
fields
.
String
,
'email'
:
fields
.
String
,
'gender'
:
fields
.
String
,
'active'
:
fields
.
Boolean
,
'date_of_join'
:
fields
.
DateTime
,
'phone_number'
:
fields
.
String
,
'email_verified'
:
fields
.
Boolean
,
'phone_verified'
:
fields
.
Boolean
,
'status'
:
fields
.
String
,
'user_roles'
:
fields
.
List
(
fields
.
String
(
default
=
'{}'
,
description
=
'user roles object in json'
)
),
'created_at'
:
fields
.
DateTime
,
'created_by'
:
fields
.
Integer
,
'updated_at'
:
fields
.
DateTime
,
'updated_by'
:
fields
.
Integer
,
'is_deleted'
:
fields
.
Boolean
,
},
)
...
...
database/query.sql
View file @
eee5b6cd
INSERT
INTO
public
.
webomagic_user
(
username
,
first_name
,
last_name
,
"password"
,
phone
,
name
,
password
,
organization
,
email
,
gender
,
active
,
date_of_join
phone_number
,
status
)
VALUES
(
VALUES
(
'deepdey'
,
'Deep'
,
'Dey'
,
'Deep Dey'
,
'$2b$12$du0B3AlnD5wOYxt.ADYPwuaCFqF7R3XrLHDiNca4FvVtTGPIQVEu2'
,
'
8697448896
'
,
'
WebsoftTechs
'
,
'deep.websofttechs@gmail.com'
,
'UNDEFINED'
,
true
,
0
'8697448896'
,
'IN_ACTIVE'
);
INSERT
INTO
public
.
role_type
(
role_name
,
is_deleted
)
VALUES
(
'SUPER_ADMIN'
,
false
),
VALUES
(
'SUPER_ADMIN'
,
false
),
(
'PROJECT_ADMIN'
,
false
),
(
'PROJECT_STAFF'
,
false
),
(
'PROJECT_USER'
,
false
);
INSERT
INTO
public
.
role
(
role_type_id
,
role_name
,
project_id
,
is_deleted
)
VALUES
(
1
,
'PROJECT_ADMIN'
,
1
,
false
),
(
3
,
'PRODUCT_MANAGER'
,
1
,
false
);
public
.
role
(
role_type_id
,
role_name
,
project_id
,
is_deleted
)
VALUES
(
1
,
'PROJECT_ADMIN'
,
1
,
false
),
(
3
,
'PRODUCT_MANAGER'
,
1
,
false
);
INSERT
INTO
public
.
webomagic_api
(
endpoint
,
method
,
tag
)
VALUES
(
'/webomagic-user/v1/profile'
,
'GET'
,
'RA'
);
VALUES
(
'/webomagic-user/v1/profile'
,
'GET'
,
'RA'
);
\ No newline at end of file
database/schema.sql
View file @
eee5b6cd
...
...
@@ -33,17 +33,22 @@ CREATE TABLE
IF
NOT
EXISTS
webomagic_user
(
id
BIGSERIAL
PRIMARY
KEY
NOT
NULL
,
username
VARCHAR
(
80
)
UNIQUE
NOT
NULL
,
first_name
VARCHAR
(
80
)
NOT
NULL
,
last_name
VARCHAR
(
80
)
NOT
NULL
,
name
VARCHAR
(
255
)
NOT
NULL
,
password
VARCHAR
(
80
)
NOT
NULL
,
phone
VARCHAR
(
20
)
UNIQUE
NOT
NULL
,
organization
VARCHAR
(
255
),
gstin
VARCHAR
(
50
),
email
VARCHAR
(
120
)
UNIQUE
NOT
NULL
,
gender
VARCHAR
(
20
)
NOT
NULL
,
active
BOOLEAN
DEFAULT
true
,
date_of_join
BIGINT
NOT
NULL
,
phone_number
VARCHAR
(
20
)
UNIQUE
NOT
NULL
,
phone_verified
BOOLEAN
DEFAULT
false
,
email_verified
BOOLEAN
DEFAULT
false
,
status
VARCHAR
(
20
)
NOT
NULL
,
is_deleted
BOOLEAN
DEFAULT
false
,
created_at
TIMESTAMP
NOT
NULL
DEFAULT
now
(),
updated_at
TIMESTAMP
created_by
BIGINT
,
updated_at
TIMESTAMP
,
updated_by
BIGINT
,
FOREIGN
KEY
(
created_by
)
REFERENCES
webomagic_user
(
id
),
FOREIGN
KEY
(
updated_by
)
REFERENCES
webomagic_user
(
id
)
);
CREATE
TABLE
...
...
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