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
7ff3eec0
Commit
7ff3eec0
authored
Jul 13, 2024
by
deepdey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update database schema and query
parent
7722594f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
18 deletions
+56
-18
database/query.sql
database/query.sql
+24
-6
database/schema.sql
database/schema.sql
+32
-12
No files found.
database/query.sql
View file @
7ff3eec0
INSERT
INTO
public
.
webomagic_user
(
username
,
...
...
@@ -13,13 +12,32 @@ INSERT INTO
)
VALUES
(
'
lamartiniere
'
,
'
La Martiniere
'
,
''
,
'
deepdey
'
,
'
Deep
'
,
'
Dey
'
,
'$2b$12$du0B3AlnD5wOYxt.ADYPwuaCFqF7R3XrLHDiNca4FvVtTGPIQVEu2'
,
'
03340406612
'
,
'
admin@lamartiniere.co
'
,
'
8697448896
'
,
'
deep.websofttechs@gmail.com
'
,
'UNDEFINED'
,
true
,
0
);
INSERT
INTO
public
.
role_type
(
role_name
,
is_deleted
)
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
);
INSERT
INTO
public
.
webomagic_api
(
endpoint
,
method
)
VALUES
(
'/webomagic-user/v1/profile'
,
'GET'
);
database/schema.sql
View file @
7ff3eec0
CREATE
TABLE
IF
NOT
EXISTS
api_authorization
(
IF
NOT
EXISTS
webomagic_api
(
id
BIGSERIAL
PRIMARY
KEY
NOT
NULL
,
endpoint
VARCHAR
(
255
)
NOT
NULL
,
associated_roles
BIGINT
[]
NOT
NULL
method
VARCHAR
(
10
)
NOT
NULL
,
created_at
TIMESTAMP
NOT
NULL
DEFAULT
now
(),
updated_at
TIMESTAMP
);
CREATE
TABLE
...
...
@@ -14,6 +16,18 @@ CREATE TABLE
updated_at
TIMESTAMP
);
CREATE
TABLE
IF
NOT
EXISTS
role
(
id
BIGSERIAL
PRIMARY
KEY
NOT
NULL
,
role_type_id
BIGINT
NOT
NULL
,
role_name
VARCHAR
(
80
)
NOT
NULL
,
project_id
BIGINT
NOT
NULL
,
is_deleted
BOOLEAN
DEFAULT
false
,
created_at
TIMESTAMP
NOT
NULL
DEFAULT
now
(),
updated_at
TIMESTAMP
,
FOREIGN
KEY
(
role_type_id
)
REFERENCES
role_type
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
webomagic_user
(
id
BIGSERIAL
PRIMARY
KEY
NOT
NULL
,
...
...
@@ -32,17 +46,23 @@ CREATE TABLE
);
CREATE
TABLE
IF
NOT
EXISTS
role
(
IF
NOT
EXISTS
user_role_mapping
(
id
BIGSERIAL
PRIMARY
KEY
NOT
NULL
,
role_type_id
BIGINT
NOT
NULL
,
role_name
VARCHAR
(
80
)
NOT
NULL
,
project_id
BIGINT
NOT
NULL
,
is_deleted
BOOLEAN
DEFAULT
false
,
user_id
BIGINT
NOT
NULL
,
role_id
BIGINT
NOT
NULL
,
created_at
TIMESTAMP
NOT
NULL
DEFAULT
now
(),
updated_at
TIMESTAMP
,
FOREIGN
KEY
(
user_id
)
REFERENCES
webomagic_user
(
id
),
FOREIGN
KEY
(
role_id
)
REFERENCES
role
(
id
)
);
CREATE
TABLE
IF
NOT
EXISTS
user_api_mapping
(
id
BIGSERIAL
PRIMARY
KEY
NOT
NULL
,
role_id
BIGINT
NOT
NULL
,
api_id
BIGINT
NOT
NULL
,
created_at
TIMESTAMP
NOT
NULL
DEFAULT
now
(),
created_by
BIGINT
NOT
NULL
,
updated_at
TIMESTAMP
,
updated_by
BIGINT
,
FOREIGN
KEY
(
role_type_id
)
REFERENCES
role_type
(
id
),
FOREIGN
KEY
(
created_by
)
REFERENCES
webomagic_user
(
id
),
FOREIGN
KEY
(
updated_by
)
REFERENCES
webomagic_user
(
id
)
FOREIGN
KEY
(
role_id
)
REFERENCES
role
(
id
),
FOREIGN
KEY
(
api_id
)
REFERENCES
webomagic_api
(
id
)
);
\ No newline at end of file
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