The next generation of the Teknik Services. Written in ASP.NET. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20180930040544_InitialIdentityServerConfigurationDbMigration.cs 28KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. using System;
  2. using Microsoft.EntityFrameworkCore.Metadata;
  3. using Microsoft.EntityFrameworkCore.Migrations;
  4. namespace Teknik.IdentityServer.Data.Migrations.IdentityServer.ConfigurationDb
  5. {
  6. public partial class InitialIdentityServerConfigurationDbMigration : Migration
  7. {
  8. protected override void Up(MigrationBuilder migrationBuilder)
  9. {
  10. migrationBuilder.CreateTable(
  11. name: "ApiResources",
  12. columns: table => new
  13. {
  14. Id = table.Column<int>(nullable: false)
  15. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  16. Enabled = table.Column<bool>(nullable: false),
  17. Name = table.Column<string>(maxLength: 200, nullable: false),
  18. DisplayName = table.Column<string>(maxLength: 200, nullable: true),
  19. Description = table.Column<string>(maxLength: 1000, nullable: true),
  20. Created = table.Column<DateTime>(nullable: false),
  21. Updated = table.Column<DateTime>(nullable: true),
  22. LastAccessed = table.Column<DateTime>(nullable: true)
  23. },
  24. constraints: table =>
  25. {
  26. table.PrimaryKey("PK_ApiResources", x => x.Id);
  27. });
  28. migrationBuilder.CreateTable(
  29. name: "Clients",
  30. columns: table => new
  31. {
  32. Id = table.Column<int>(nullable: false)
  33. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  34. Enabled = table.Column<bool>(nullable: false),
  35. ClientId = table.Column<string>(maxLength: 200, nullable: false),
  36. ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
  37. RequireClientSecret = table.Column<bool>(nullable: false),
  38. ClientName = table.Column<string>(maxLength: 200, nullable: true),
  39. Description = table.Column<string>(maxLength: 1000, nullable: true),
  40. ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
  41. LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
  42. RequireConsent = table.Column<bool>(nullable: false),
  43. AllowRememberConsent = table.Column<bool>(nullable: false),
  44. AlwaysIncludeUserClaimsInIdToken = table.Column<bool>(nullable: false),
  45. RequirePkce = table.Column<bool>(nullable: false),
  46. AllowPlainTextPkce = table.Column<bool>(nullable: false),
  47. AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
  48. FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
  49. FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
  50. BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
  51. BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
  52. AllowOfflineAccess = table.Column<bool>(nullable: false),
  53. IdentityTokenLifetime = table.Column<int>(nullable: false),
  54. AccessTokenLifetime = table.Column<int>(nullable: false),
  55. AuthorizationCodeLifetime = table.Column<int>(nullable: false),
  56. ConsentLifetime = table.Column<int>(nullable: true),
  57. AbsoluteRefreshTokenLifetime = table.Column<int>(nullable: false),
  58. SlidingRefreshTokenLifetime = table.Column<int>(nullable: false),
  59. RefreshTokenUsage = table.Column<int>(nullable: false),
  60. UpdateAccessTokenClaimsOnRefresh = table.Column<bool>(nullable: false),
  61. RefreshTokenExpiration = table.Column<int>(nullable: false),
  62. AccessTokenType = table.Column<int>(nullable: false),
  63. EnableLocalLogin = table.Column<bool>(nullable: false),
  64. IncludeJwtId = table.Column<bool>(nullable: false),
  65. AlwaysSendClientClaims = table.Column<bool>(nullable: false),
  66. ClientClaimsPrefix = table.Column<string>(maxLength: 200, nullable: true),
  67. PairWiseSubjectSalt = table.Column<string>(maxLength: 200, nullable: true),
  68. Created = table.Column<DateTime>(nullable: false),
  69. Updated = table.Column<DateTime>(nullable: true),
  70. LastAccessed = table.Column<DateTime>(nullable: true)
  71. },
  72. constraints: table =>
  73. {
  74. table.PrimaryKey("PK_Clients", x => x.Id);
  75. });
  76. migrationBuilder.CreateTable(
  77. name: "IdentityResources",
  78. columns: table => new
  79. {
  80. Id = table.Column<int>(nullable: false)
  81. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  82. Enabled = table.Column<bool>(nullable: false),
  83. Name = table.Column<string>(maxLength: 200, nullable: false),
  84. DisplayName = table.Column<string>(maxLength: 200, nullable: true),
  85. Description = table.Column<string>(maxLength: 1000, nullable: true),
  86. Required = table.Column<bool>(nullable: false),
  87. Emphasize = table.Column<bool>(nullable: false),
  88. ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
  89. Created = table.Column<DateTime>(nullable: false),
  90. Updated = table.Column<DateTime>(nullable: true)
  91. },
  92. constraints: table =>
  93. {
  94. table.PrimaryKey("PK_IdentityResources", x => x.Id);
  95. });
  96. migrationBuilder.CreateTable(
  97. name: "ApiClaims",
  98. columns: table => new
  99. {
  100. Id = table.Column<int>(nullable: false)
  101. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  102. Type = table.Column<string>(maxLength: 200, nullable: false),
  103. ApiResourceId = table.Column<int>(nullable: false)
  104. },
  105. constraints: table =>
  106. {
  107. table.PrimaryKey("PK_ApiClaims", x => x.Id);
  108. table.ForeignKey(
  109. name: "FK_ApiClaims_ApiResources_ApiResourceId",
  110. column: x => x.ApiResourceId,
  111. principalTable: "ApiResources",
  112. principalColumn: "Id",
  113. onDelete: ReferentialAction.Cascade);
  114. });
  115. migrationBuilder.CreateTable(
  116. name: "ApiProperties",
  117. columns: table => new
  118. {
  119. Id = table.Column<int>(nullable: false)
  120. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  121. Key = table.Column<string>(maxLength: 250, nullable: false),
  122. Value = table.Column<string>(maxLength: 2000, nullable: false),
  123. ApiResourceId = table.Column<int>(nullable: false)
  124. },
  125. constraints: table =>
  126. {
  127. table.PrimaryKey("PK_ApiProperties", x => x.Id);
  128. table.ForeignKey(
  129. name: "FK_ApiProperties_ApiResources_ApiResourceId",
  130. column: x => x.ApiResourceId,
  131. principalTable: "ApiResources",
  132. principalColumn: "Id",
  133. onDelete: ReferentialAction.Cascade);
  134. });
  135. migrationBuilder.CreateTable(
  136. name: "ApiScopes",
  137. columns: table => new
  138. {
  139. Id = table.Column<int>(nullable: false)
  140. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  141. Name = table.Column<string>(maxLength: 200, nullable: false),
  142. DisplayName = table.Column<string>(maxLength: 200, nullable: true),
  143. Description = table.Column<string>(maxLength: 1000, nullable: true),
  144. Required = table.Column<bool>(nullable: false),
  145. Emphasize = table.Column<bool>(nullable: false),
  146. ShowInDiscoveryDocument = table.Column<bool>(nullable: false),
  147. ApiResourceId = table.Column<int>(nullable: false)
  148. },
  149. constraints: table =>
  150. {
  151. table.PrimaryKey("PK_ApiScopes", x => x.Id);
  152. table.ForeignKey(
  153. name: "FK_ApiScopes_ApiResources_ApiResourceId",
  154. column: x => x.ApiResourceId,
  155. principalTable: "ApiResources",
  156. principalColumn: "Id",
  157. onDelete: ReferentialAction.Cascade);
  158. });
  159. migrationBuilder.CreateTable(
  160. name: "ApiSecrets",
  161. columns: table => new
  162. {
  163. Id = table.Column<int>(nullable: false)
  164. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  165. Description = table.Column<string>(maxLength: 1000, nullable: true),
  166. Value = table.Column<string>(maxLength: 4000, nullable: false),
  167. Expiration = table.Column<DateTime>(nullable: true),
  168. Type = table.Column<string>(maxLength: 250, nullable: false),
  169. Created = table.Column<DateTime>(nullable: false),
  170. ApiResourceId = table.Column<int>(nullable: false)
  171. },
  172. constraints: table =>
  173. {
  174. table.PrimaryKey("PK_ApiSecrets", x => x.Id);
  175. table.ForeignKey(
  176. name: "FK_ApiSecrets_ApiResources_ApiResourceId",
  177. column: x => x.ApiResourceId,
  178. principalTable: "ApiResources",
  179. principalColumn: "Id",
  180. onDelete: ReferentialAction.Cascade);
  181. });
  182. migrationBuilder.CreateTable(
  183. name: "ClientClaims",
  184. columns: table => new
  185. {
  186. Id = table.Column<int>(nullable: false)
  187. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  188. Type = table.Column<string>(maxLength: 250, nullable: false),
  189. Value = table.Column<string>(maxLength: 250, nullable: false),
  190. ClientId = table.Column<int>(nullable: false)
  191. },
  192. constraints: table =>
  193. {
  194. table.PrimaryKey("PK_ClientClaims", x => x.Id);
  195. table.ForeignKey(
  196. name: "FK_ClientClaims_Clients_ClientId",
  197. column: x => x.ClientId,
  198. principalTable: "Clients",
  199. principalColumn: "Id",
  200. onDelete: ReferentialAction.Cascade);
  201. });
  202. migrationBuilder.CreateTable(
  203. name: "ClientCorsOrigins",
  204. columns: table => new
  205. {
  206. Id = table.Column<int>(nullable: false)
  207. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  208. Origin = table.Column<string>(maxLength: 150, nullable: false),
  209. ClientId = table.Column<int>(nullable: false)
  210. },
  211. constraints: table =>
  212. {
  213. table.PrimaryKey("PK_ClientCorsOrigins", x => x.Id);
  214. table.ForeignKey(
  215. name: "FK_ClientCorsOrigins_Clients_ClientId",
  216. column: x => x.ClientId,
  217. principalTable: "Clients",
  218. principalColumn: "Id",
  219. onDelete: ReferentialAction.Cascade);
  220. });
  221. migrationBuilder.CreateTable(
  222. name: "ClientGrantTypes",
  223. columns: table => new
  224. {
  225. Id = table.Column<int>(nullable: false)
  226. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  227. GrantType = table.Column<string>(maxLength: 250, nullable: false),
  228. ClientId = table.Column<int>(nullable: false)
  229. },
  230. constraints: table =>
  231. {
  232. table.PrimaryKey("PK_ClientGrantTypes", x => x.Id);
  233. table.ForeignKey(
  234. name: "FK_ClientGrantTypes_Clients_ClientId",
  235. column: x => x.ClientId,
  236. principalTable: "Clients",
  237. principalColumn: "Id",
  238. onDelete: ReferentialAction.Cascade);
  239. });
  240. migrationBuilder.CreateTable(
  241. name: "ClientIdPRestrictions",
  242. columns: table => new
  243. {
  244. Id = table.Column<int>(nullable: false)
  245. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  246. Provider = table.Column<string>(maxLength: 200, nullable: false),
  247. ClientId = table.Column<int>(nullable: false)
  248. },
  249. constraints: table =>
  250. {
  251. table.PrimaryKey("PK_ClientIdPRestrictions", x => x.Id);
  252. table.ForeignKey(
  253. name: "FK_ClientIdPRestrictions_Clients_ClientId",
  254. column: x => x.ClientId,
  255. principalTable: "Clients",
  256. principalColumn: "Id",
  257. onDelete: ReferentialAction.Cascade);
  258. });
  259. migrationBuilder.CreateTable(
  260. name: "ClientPostLogoutRedirectUris",
  261. columns: table => new
  262. {
  263. Id = table.Column<int>(nullable: false)
  264. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  265. PostLogoutRedirectUri = table.Column<string>(maxLength: 2000, nullable: false),
  266. ClientId = table.Column<int>(nullable: false)
  267. },
  268. constraints: table =>
  269. {
  270. table.PrimaryKey("PK_ClientPostLogoutRedirectUris", x => x.Id);
  271. table.ForeignKey(
  272. name: "FK_ClientPostLogoutRedirectUris_Clients_ClientId",
  273. column: x => x.ClientId,
  274. principalTable: "Clients",
  275. principalColumn: "Id",
  276. onDelete: ReferentialAction.Cascade);
  277. });
  278. migrationBuilder.CreateTable(
  279. name: "ClientProperties",
  280. columns: table => new
  281. {
  282. Id = table.Column<int>(nullable: false)
  283. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  284. Key = table.Column<string>(maxLength: 250, nullable: false),
  285. Value = table.Column<string>(maxLength: 2000, nullable: false),
  286. ClientId = table.Column<int>(nullable: false)
  287. },
  288. constraints: table =>
  289. {
  290. table.PrimaryKey("PK_ClientProperties", x => x.Id);
  291. table.ForeignKey(
  292. name: "FK_ClientProperties_Clients_ClientId",
  293. column: x => x.ClientId,
  294. principalTable: "Clients",
  295. principalColumn: "Id",
  296. onDelete: ReferentialAction.Cascade);
  297. });
  298. migrationBuilder.CreateTable(
  299. name: "ClientRedirectUris",
  300. columns: table => new
  301. {
  302. Id = table.Column<int>(nullable: false)
  303. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  304. RedirectUri = table.Column<string>(maxLength: 2000, nullable: false),
  305. ClientId = table.Column<int>(nullable: false)
  306. },
  307. constraints: table =>
  308. {
  309. table.PrimaryKey("PK_ClientRedirectUris", x => x.Id);
  310. table.ForeignKey(
  311. name: "FK_ClientRedirectUris_Clients_ClientId",
  312. column: x => x.ClientId,
  313. principalTable: "Clients",
  314. principalColumn: "Id",
  315. onDelete: ReferentialAction.Cascade);
  316. });
  317. migrationBuilder.CreateTable(
  318. name: "ClientScopes",
  319. columns: table => new
  320. {
  321. Id = table.Column<int>(nullable: false)
  322. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  323. Scope = table.Column<string>(maxLength: 200, nullable: false),
  324. ClientId = table.Column<int>(nullable: false)
  325. },
  326. constraints: table =>
  327. {
  328. table.PrimaryKey("PK_ClientScopes", x => x.Id);
  329. table.ForeignKey(
  330. name: "FK_ClientScopes_Clients_ClientId",
  331. column: x => x.ClientId,
  332. principalTable: "Clients",
  333. principalColumn: "Id",
  334. onDelete: ReferentialAction.Cascade);
  335. });
  336. migrationBuilder.CreateTable(
  337. name: "ClientSecrets",
  338. columns: table => new
  339. {
  340. Id = table.Column<int>(nullable: false)
  341. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  342. Description = table.Column<string>(maxLength: 2000, nullable: true),
  343. Value = table.Column<string>(maxLength: 4000, nullable: false),
  344. Expiration = table.Column<DateTime>(nullable: true),
  345. Type = table.Column<string>(maxLength: 250, nullable: false),
  346. Created = table.Column<DateTime>(nullable: false),
  347. ClientId = table.Column<int>(nullable: false)
  348. },
  349. constraints: table =>
  350. {
  351. table.PrimaryKey("PK_ClientSecrets", x => x.Id);
  352. table.ForeignKey(
  353. name: "FK_ClientSecrets_Clients_ClientId",
  354. column: x => x.ClientId,
  355. principalTable: "Clients",
  356. principalColumn: "Id",
  357. onDelete: ReferentialAction.Cascade);
  358. });
  359. migrationBuilder.CreateTable(
  360. name: "IdentityClaims",
  361. columns: table => new
  362. {
  363. Id = table.Column<int>(nullable: false)
  364. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  365. Type = table.Column<string>(maxLength: 200, nullable: false),
  366. IdentityResourceId = table.Column<int>(nullable: false)
  367. },
  368. constraints: table =>
  369. {
  370. table.PrimaryKey("PK_IdentityClaims", x => x.Id);
  371. table.ForeignKey(
  372. name: "FK_IdentityClaims_IdentityResources_IdentityResourceId",
  373. column: x => x.IdentityResourceId,
  374. principalTable: "IdentityResources",
  375. principalColumn: "Id",
  376. onDelete: ReferentialAction.Cascade);
  377. });
  378. migrationBuilder.CreateTable(
  379. name: "IdentityProperties",
  380. columns: table => new
  381. {
  382. Id = table.Column<int>(nullable: false)
  383. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  384. Key = table.Column<string>(maxLength: 250, nullable: false),
  385. Value = table.Column<string>(maxLength: 2000, nullable: false),
  386. IdentityResourceId = table.Column<int>(nullable: false)
  387. },
  388. constraints: table =>
  389. {
  390. table.PrimaryKey("PK_IdentityProperties", x => x.Id);
  391. table.ForeignKey(
  392. name: "FK_IdentityProperties_IdentityResources_IdentityResourceId",
  393. column: x => x.IdentityResourceId,
  394. principalTable: "IdentityResources",
  395. principalColumn: "Id",
  396. onDelete: ReferentialAction.Cascade);
  397. });
  398. migrationBuilder.CreateTable(
  399. name: "ApiScopeClaims",
  400. columns: table => new
  401. {
  402. Id = table.Column<int>(nullable: false)
  403. .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
  404. Type = table.Column<string>(maxLength: 200, nullable: false),
  405. ApiScopeId = table.Column<int>(nullable: false)
  406. },
  407. constraints: table =>
  408. {
  409. table.PrimaryKey("PK_ApiScopeClaims", x => x.Id);
  410. table.ForeignKey(
  411. name: "FK_ApiScopeClaims_ApiScopes_ApiScopeId",
  412. column: x => x.ApiScopeId,
  413. principalTable: "ApiScopes",
  414. principalColumn: "Id",
  415. onDelete: ReferentialAction.Cascade);
  416. });
  417. migrationBuilder.CreateIndex(
  418. name: "IX_ApiClaims_ApiResourceId",
  419. table: "ApiClaims",
  420. column: "ApiResourceId");
  421. migrationBuilder.CreateIndex(
  422. name: "IX_ApiProperties_ApiResourceId",
  423. table: "ApiProperties",
  424. column: "ApiResourceId");
  425. migrationBuilder.CreateIndex(
  426. name: "IX_ApiResources_Name",
  427. table: "ApiResources",
  428. column: "Name",
  429. unique: true);
  430. migrationBuilder.CreateIndex(
  431. name: "IX_ApiScopeClaims_ApiScopeId",
  432. table: "ApiScopeClaims",
  433. column: "ApiScopeId");
  434. migrationBuilder.CreateIndex(
  435. name: "IX_ApiScopes_ApiResourceId",
  436. table: "ApiScopes",
  437. column: "ApiResourceId");
  438. migrationBuilder.CreateIndex(
  439. name: "IX_ApiScopes_Name",
  440. table: "ApiScopes",
  441. column: "Name",
  442. unique: true);
  443. migrationBuilder.CreateIndex(
  444. name: "IX_ApiSecrets_ApiResourceId",
  445. table: "ApiSecrets",
  446. column: "ApiResourceId");
  447. migrationBuilder.CreateIndex(
  448. name: "IX_ClientClaims_ClientId",
  449. table: "ClientClaims",
  450. column: "ClientId");
  451. migrationBuilder.CreateIndex(
  452. name: "IX_ClientCorsOrigins_ClientId",
  453. table: "ClientCorsOrigins",
  454. column: "ClientId");
  455. migrationBuilder.CreateIndex(
  456. name: "IX_ClientGrantTypes_ClientId",
  457. table: "ClientGrantTypes",
  458. column: "ClientId");
  459. migrationBuilder.CreateIndex(
  460. name: "IX_ClientIdPRestrictions_ClientId",
  461. table: "ClientIdPRestrictions",
  462. column: "ClientId");
  463. migrationBuilder.CreateIndex(
  464. name: "IX_ClientPostLogoutRedirectUris_ClientId",
  465. table: "ClientPostLogoutRedirectUris",
  466. column: "ClientId");
  467. migrationBuilder.CreateIndex(
  468. name: "IX_ClientProperties_ClientId",
  469. table: "ClientProperties",
  470. column: "ClientId");
  471. migrationBuilder.CreateIndex(
  472. name: "IX_ClientRedirectUris_ClientId",
  473. table: "ClientRedirectUris",
  474. column: "ClientId");
  475. migrationBuilder.CreateIndex(
  476. name: "IX_Clients_ClientId",
  477. table: "Clients",
  478. column: "ClientId",
  479. unique: true);
  480. migrationBuilder.CreateIndex(
  481. name: "IX_ClientScopes_ClientId",
  482. table: "ClientScopes",
  483. column: "ClientId");
  484. migrationBuilder.CreateIndex(
  485. name: "IX_ClientSecrets_ClientId",
  486. table: "ClientSecrets",
  487. column: "ClientId");
  488. migrationBuilder.CreateIndex(
  489. name: "IX_IdentityClaims_IdentityResourceId",
  490. table: "IdentityClaims",
  491. column: "IdentityResourceId");
  492. migrationBuilder.CreateIndex(
  493. name: "IX_IdentityProperties_IdentityResourceId",
  494. table: "IdentityProperties",
  495. column: "IdentityResourceId");
  496. migrationBuilder.CreateIndex(
  497. name: "IX_IdentityResources_Name",
  498. table: "IdentityResources",
  499. column: "Name",
  500. unique: true);
  501. }
  502. protected override void Down(MigrationBuilder migrationBuilder)
  503. {
  504. migrationBuilder.DropTable(
  505. name: "ApiClaims");
  506. migrationBuilder.DropTable(
  507. name: "ApiProperties");
  508. migrationBuilder.DropTable(
  509. name: "ApiScopeClaims");
  510. migrationBuilder.DropTable(
  511. name: "ApiSecrets");
  512. migrationBuilder.DropTable(
  513. name: "ClientClaims");
  514. migrationBuilder.DropTable(
  515. name: "ClientCorsOrigins");
  516. migrationBuilder.DropTable(
  517. name: "ClientGrantTypes");
  518. migrationBuilder.DropTable(
  519. name: "ClientIdPRestrictions");
  520. migrationBuilder.DropTable(
  521. name: "ClientPostLogoutRedirectUris");
  522. migrationBuilder.DropTable(
  523. name: "ClientProperties");
  524. migrationBuilder.DropTable(
  525. name: "ClientRedirectUris");
  526. migrationBuilder.DropTable(
  527. name: "ClientScopes");
  528. migrationBuilder.DropTable(
  529. name: "ClientSecrets");
  530. migrationBuilder.DropTable(
  531. name: "IdentityClaims");
  532. migrationBuilder.DropTable(
  533. name: "IdentityProperties");
  534. migrationBuilder.DropTable(
  535. name: "ApiScopes");
  536. migrationBuilder.DropTable(
  537. name: "Clients");
  538. migrationBuilder.DropTable(
  539. name: "IdentityResources");
  540. migrationBuilder.DropTable(
  541. name: "ApiResources");
  542. }
  543. }
  544. }