-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSQLQuery4.sql
34 lines (23 loc) · 1.22 KB
/
SQLQuery4.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
select * from AspNetUsers;
delete from AspNetUsers where email='[email protected]';
alter table vehicle add image_path varchar(255);
select * from Vehicle;
select * from userrolesbridging;
insert into [dbo].[userrolesbridging] values ('bd44b938-8f13-45c4-96ee-08dd988b5d9c','2');
insert into [dbo].[Vehicle] ([Name],[Model],[userId],[image_path]) Values ('mazda', '2003', 'bd44b938-8f13-45c4-96ee-08dd988b5d9c', 'file.jpg');
create table [dbo].[userrolesbridging](
[Id] int IDENTITY(1,1) NOT NULL,
[userid] NVARCHAR (128) NOT NULL,
[roleid] NVARCHAR (128) NOT NULL,
PRIMARY KEY(Id),
FOREIGN KEY(userid) REFERENCES AspNetUsers(Id),
FOREIGN KEY(roleid) REFERENCES AspNetRoles(Id),
);
CREATE TABLE [dbo].[userrolesbridging] (
[Id] int IDENTITY(1,1) NOT NULL,
[UserId] NVARCHAR (128) NOT NULL,
[RoleId] NVARCHAR (128) NOT NULL,
CONSTRAINT [PK_dbo.userrolesbridging] PRIMARY KEY CLUSTERED ([UserId] ASC, [RoleId] ASC),
CONSTRAINT [FK_dbo.userrolesbridging_dbo.AspNetRoles_RoleId] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[AspNetRoles] ([Id]) ON DELETE CASCADE,
CONSTRAINT [FK_dbo.userrolesbridging_dbo.AspNetUsers_UserId] FOREIGN KEY ([UserId]) REFERENCES [dbo].[AspNetUsers] ([Id]) ON DELETE CASCADE
);