diff --git a/api/Migrations/20190214165735_teams.cs b/api/Migrations/20190214165735_teams.cs deleted file mode 100644 index 0e335ae2..00000000 --- a/api/Migrations/20190214165735_teams.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace api.Migrations -{ - public partial class teams : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TeamId", - table: "AspNetUsers", - nullable: true); - - migrationBuilder.CreateTable( - name: "Teams", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Nome = table.Column(nullable: true), - Event = table.Column(nullable: false), - NumMemb = table.Column(nullable: false), - VisitedNum = table.Column(nullable: false), - Pontos = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Teams", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "EventQR", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Event = table.Column(nullable: false), - TeamId = table.Column(nullable: false), - EventLocId = table.Column(nullable: false), - Pontos = table.Column(nullable: false), - TimeGen = table.Column(nullable: false), - QRData = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_EventQR", x => x.Id); - table.ForeignKey( - name: "FK_EventQR_Teams_TeamId", - column: x => x.TeamId, - principalTable: "Teams", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUsers_TeamId", - table: "AspNetUsers", - column: "TeamId"); - - migrationBuilder.CreateIndex( - name: "IX_EventQR_TeamId", - table: "EventQR", - column: "TeamId"); - - migrationBuilder.AddForeignKey( - name: "FK_AspNetUsers_Teams_TeamId", - table: "AspNetUsers", - column: "TeamId", - principalTable: "Teams", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_AspNetUsers_Teams_TeamId", - table: "AspNetUsers"); - - migrationBuilder.DropTable( - name: "EventQR"); - - migrationBuilder.DropTable( - name: "Teams"); - - migrationBuilder.DropIndex( - name: "IX_AspNetUsers_TeamId", - table: "AspNetUsers"); - - migrationBuilder.DropColumn( - name: "TeamId", - table: "AspNetUsers"); - } - } -} diff --git a/api/Migrations/20190214165735_teams.Designer.cs b/api/Migrations/20190214193256_uo.Designer.cs similarity index 90% rename from api/Migrations/20190214165735_teams.Designer.cs rename to api/Migrations/20190214193256_uo.Designer.cs index 38655693..ef43d8a6 100644 --- a/api/Migrations/20190214165735_teams.Designer.cs +++ b/api/Migrations/20190214193256_uo.Designer.cs @@ -9,14 +9,83 @@ using api.Data; namespace api.Migrations { [DbContext(typeof(DataContext))] - [Migration("20190214165735_teams")] - partial class teams + [Migration("20190214193256_uo")] + partial class uo { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); + .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); modelBuilder.Entity("api.Models.EventQR", b => { @@ -112,36 +181,16 @@ namespace api.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("About"); - b.Property("AccessFailedCount"); - b.Property("Adress"); - - b.Property("Age"); - - b.Property("City"); - - b.Property("Company"); - b.Property("ConcurrencyStamp") .IsConcurrencyToken(); - b.Property("Country"); - - b.Property("Degree"); - b.Property("Email") .HasMaxLength(256); b.Property("EmailConfirmed"); - b.Property("FullName"); - - b.Property("Gender"); - - b.Property("LastLogin"); - b.Property("LockoutEnabled"); b.Property("LockoutEnd"); @@ -154,37 +203,21 @@ namespace api.Migrations b.Property("PasswordHash"); - b.Property("Phone"); - b.Property("PhoneNumber"); b.Property("PhoneNumberConfirmed"); - b.Property("Position"); - - b.Property("ProfileIcon"); - b.Property("QRcode"); - b.Property("Registed"); - - b.Property("Role"); - - b.Property("SchoolYear"); - b.Property("SecurityStamp"); b.Property("TeamId"); b.Property("TwoFactorEnabled"); - b.Property("University"); - b.Property("UserName") .HasMaxLength(256); - b.Property("linkedIn"); - b.HasKey("Id"); b.HasIndex("NormalizedEmail") @@ -226,70 +259,34 @@ namespace api.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); + b.HasOne("api.Models.Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); + b.HasOne("api.Models.User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); + b.HasOne("api.Models.User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); + b.HasOne("api.Models.User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("api.Models.EventQR", b => @@ -327,38 +324,6 @@ namespace api.Migrations .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("api.Models.Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("api.Models.User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("api.Models.User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("api.Models.User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); #pragma warning restore 612, 618 } } diff --git a/api/Migrations/20180829184152_update.cs b/api/Migrations/20190214193256_uo.cs old mode 100755 new mode 100644 similarity index 74% rename from api/Migrations/20180829184152_update.cs rename to api/Migrations/20190214193256_uo.cs index b196307d..0a4f09b0 --- a/api/Migrations/20180829184152_update.cs +++ b/api/Migrations/20190214193256_uo.cs @@ -1,9 +1,10 @@ using System; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace api.Migrations { - public partial class update : Migration + public partial class uo : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -12,7 +13,7 @@ namespace api.Migrations columns: table => new { Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(maxLength: 256, nullable: true), NormalizedName = table.Column(maxLength: 256, nullable: true), ConcurrencyStamp = table.Column(nullable: true) @@ -23,48 +24,20 @@ namespace api.Migrations }); migrationBuilder.CreateTable( - name: "AspNetUsers", + name: "Teams", columns: table => new { - AccessFailedCount = table.Column(nullable: false), - EmailConfirmed = table.Column(nullable: false), Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - LockoutEnabled = table.Column(nullable: false), - LockoutEnd = table.Column(nullable: true), - PhoneNumberConfirmed = table.Column(nullable: false), - TwoFactorEnabled = table.Column(nullable: false), - UserName = table.Column(maxLength: 256, nullable: true), - NormalizedUserName = table.Column(maxLength: 256, nullable: true), - Email = table.Column(maxLength: 256, nullable: true), - NormalizedEmail = table.Column(maxLength: 256, nullable: true), - PasswordHash = table.Column(nullable: true), - SecurityStamp = table.Column(nullable: true), - ConcurrencyStamp = table.Column(nullable: true), - PhoneNumber = table.Column(nullable: true), - FullName = table.Column(nullable: true), - Gender = table.Column(nullable: true), - Age = table.Column(nullable: false), - Phone = table.Column(nullable: false), - University = table.Column(nullable: true), - Adress = table.Column(nullable: true), - Country = table.Column(nullable: true), - City = table.Column(nullable: true), - linkedIn = table.Column(nullable: true), - LastLogin = table.Column(nullable: false), - Registed = table.Column(nullable: false), - QRcode = table.Column(nullable: true), - Role = table.Column(nullable: true), - Degree = table.Column(nullable: true), - SchoolYear = table.Column(nullable: false), - ProfileIcon = table.Column(nullable: true), - Company = table.Column(nullable: true), - Position = table.Column(nullable: true), - About = table.Column(nullable: true) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Nome = table.Column(nullable: true), + Event = table.Column(nullable: false), + NumMemb = table.Column(nullable: false), + VisitedNum = table.Column(nullable: false), + Pontos = table.Column(nullable: false) }, constraints: table => { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); + table.PrimaryKey("PK_Teams", x => x.Id); }); migrationBuilder.CreateTable( @@ -72,7 +45,7 @@ namespace api.Migrations columns: table => new { id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(nullable: true) }, constraints: table => @@ -85,7 +58,7 @@ namespace api.Migrations columns: table => new { Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), RoleId = table.Column(nullable: false), ClaimType = table.Column(nullable: true), ClaimValue = table.Column(nullable: true) @@ -101,12 +74,70 @@ namespace api.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "AspNetUsers", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserName = table.Column(maxLength: 256, nullable: true), + NormalizedUserName = table.Column(maxLength: 256, nullable: true), + Email = table.Column(maxLength: 256, nullable: true), + NormalizedEmail = table.Column(maxLength: 256, nullable: true), + EmailConfirmed = table.Column(nullable: false), + PasswordHash = table.Column(nullable: true), + SecurityStamp = table.Column(nullable: true), + ConcurrencyStamp = table.Column(nullable: true), + PhoneNumber = table.Column(nullable: true), + PhoneNumberConfirmed = table.Column(nullable: false), + TwoFactorEnabled = table.Column(nullable: false), + LockoutEnd = table.Column(nullable: true), + LockoutEnabled = table.Column(nullable: false), + AccessFailedCount = table.Column(nullable: false), + QRcode = table.Column(nullable: true), + TeamId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AspNetUsers", x => x.Id); + table.ForeignKey( + name: "FK_AspNetUsers_Teams_TeamId", + column: x => x.TeamId, + principalTable: "Teams", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "EventQR", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Event = table.Column(nullable: false), + TeamId = table.Column(nullable: false), + EventLocId = table.Column(nullable: false), + Pontos = table.Column(nullable: false), + TimeGen = table.Column(nullable: false), + QRData = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EventQR", x => x.Id); + table.ForeignKey( + name: "FK_EventQR_Teams_TeamId", + column: x => x.TeamId, + principalTable: "Teams", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "AspNetUserClaims", columns: table => new { Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UserId = table.Column(nullable: false), ClaimType = table.Column(nullable: true), ClaimValue = table.Column(nullable: true) @@ -146,8 +177,8 @@ namespace api.Migrations name: "AspNetUserRoles", columns: table => new { - RoleId = table.Column(nullable: false), - UserId = table.Column(nullable: false) + UserId = table.Column(nullable: false), + RoleId = table.Column(nullable: false) }, constraints: table => { @@ -191,7 +222,7 @@ namespace api.Migrations columns: table => new { Id = table.Column(nullable: false) - .Annotation("Sqlite:Autoincrement", true), + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Url = table.Column(nullable: true), Description = table.Column(nullable: true), DateAdded = table.Column(nullable: false), @@ -246,6 +277,16 @@ namespace api.Migrations column: "NormalizedUserName", unique: true); + migrationBuilder.CreateIndex( + name: "IX_AspNetUsers_TeamId", + table: "AspNetUsers", + column: "TeamId"); + + migrationBuilder.CreateIndex( + name: "IX_EventQR_TeamId", + table: "EventQR", + column: "TeamId"); + migrationBuilder.CreateIndex( name: "IX_Photos_UserId", table: "Photos", @@ -269,6 +310,9 @@ namespace api.Migrations migrationBuilder.DropTable( name: "AspNetUserTokens"); + migrationBuilder.DropTable( + name: "EventQR"); + migrationBuilder.DropTable( name: "Photos"); @@ -280,6 +324,9 @@ namespace api.Migrations migrationBuilder.DropTable( name: "AspNetUsers"); + + migrationBuilder.DropTable( + name: "Teams"); } } } diff --git a/api/Migrations/20180829184152_update.Designer.cs b/api/Migrations/20190214202719_nova.Designer.cs old mode 100755 new mode 100644 similarity index 80% rename from api/Migrations/20180829184152_update.Designer.cs rename to api/Migrations/20190214202719_nova.Designer.cs index 7ec6128e..c8e065bd --- a/api/Migrations/20180829184152_update.Designer.cs +++ b/api/Migrations/20190214202719_nova.Designer.cs @@ -9,172 +9,15 @@ using api.Data; namespace api.Migrations { [DbContext(typeof(DataContext))] - [Migration("20180829184152_update")] - partial class update + [Migration("20190214202719_nova")] + partial class nova { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.1-rtm-30846"); - - modelBuilder.Entity("api.Models.Photo", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("DateAdded"); - - b.Property("Description"); - - b.Property("IsMain"); - - b.Property("Url"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("Photos"); - }); - - modelBuilder.Entity("api.Models.Role", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Name") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("api.Models.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("About"); - - b.Property("AccessFailedCount"); - - b.Property("Adress"); - - b.Property("Age"); - - b.Property("City"); - - b.Property("Company"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken(); - - b.Property("Country"); - - b.Property("Degree"); - - b.Property("Email") - .HasMaxLength(256); - - b.Property("EmailConfirmed"); - - b.Property("FullName"); - - b.Property("Gender"); - - b.Property("LastLogin"); - - b.Property("LockoutEnabled"); - - b.Property("LockoutEnd"); - - b.Property("NormalizedEmail") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasMaxLength(256); - - b.Property("PasswordHash"); - - b.Property("Phone"); - - b.Property("PhoneNumber"); - - b.Property("PhoneNumberConfirmed"); - - b.Property("Position"); - - b.Property("ProfileIcon"); - - b.Property("QRcode"); - - b.Property("Registed"); - - b.Property("Role"); - - b.Property("SchoolYear"); - - b.Property("SecurityStamp"); - - b.Property("TwoFactorEnabled"); - - b.Property("University"); - - b.Property("UserName") - .HasMaxLength(256); - - b.Property("linkedIn"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("api.Models.UserRole", b => - { - b.Property("UserId"); - - b.Property("RoleId"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("api.Models.Value", b => - { - b.Property("id") - .ValueGeneratedOnAdd(); - - b.Property("Name"); - - b.HasKey("id"); - - b.ToTable("Values"); - }); + .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("Relational:MaxIdentifierLength", 64); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { @@ -244,25 +87,174 @@ namespace api.Migrations b.ToTable("AspNetUserTokens"); }); + modelBuilder.Entity("api.Models.EventQR", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Event"); + + b.Property("EventLocId"); + + b.Property("Pontos"); + + b.Property("QRData"); + + b.Property("TeamId"); + + b.Property("TimeGen"); + + b.HasKey("Id"); + + b.HasIndex("TeamId"); + + b.ToTable("EventQR"); + }); + modelBuilder.Entity("api.Models.Photo", b => { - b.HasOne("api.Models.User", "User") - .WithMany("Photos") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("DateAdded"); + + b.Property("Description"); + + b.Property("IsMain"); + + b.Property("Url"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Photos"); + }); + + modelBuilder.Entity("api.Models.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Name") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("api.Models.Team", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Event"); + + b.Property("Nome"); + + b.Property("NumMemb"); + + b.Property("Pontos"); + + b.Property("VisitedNum"); + + b.HasKey("Id"); + + b.ToTable("Teams"); + }); + + modelBuilder.Entity("api.Models.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AccessFailedCount"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken(); + + b.Property("Email") + .HasMaxLength(256); + + b.Property("EmailConfirmed"); + + b.Property("LockoutEnabled"); + + b.Property("LockoutEnd"); + + b.Property("NormalizedEmail") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasMaxLength(256); + + b.Property("PasswordHash"); + + b.Property("PhoneNumber"); + + b.Property("PhoneNumberConfirmed"); + + b.Property("QRcode"); + + b.Property("SecurityStamp"); + + b.Property("TeamId"); + + b.Property("TwoFactorEnabled"); + + b.Property("UserName") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.HasIndex("TeamId"); + + b.ToTable("AspNetUsers"); }); modelBuilder.Entity("api.Models.UserRole", b => { - b.HasOne("api.Models.Role", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); + b.Property("UserId"); - b.HasOne("api.Models.User", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); + b.Property("RoleId"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("api.Models.Value", b => + { + b.Property("id") + .ValueGeneratedOnAdd(); + + b.Property("Name"); + + b.HasKey("id"); + + b.ToTable("Values"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => @@ -296,6 +288,42 @@ namespace api.Migrations .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); + + modelBuilder.Entity("api.Models.EventQR", b => + { + b.HasOne("api.Models.Team") + .WithMany("QRs") + .HasForeignKey("TeamId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("api.Models.Photo", b => + { + b.HasOne("api.Models.User", "User") + .WithMany("Photos") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("api.Models.User", b => + { + b.HasOne("api.Models.Team") + .WithMany("Users") + .HasForeignKey("TeamId"); + }); + + modelBuilder.Entity("api.Models.UserRole", b => + { + b.HasOne("api.Models.Role", "Role") + .WithMany("UserRoles") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("api.Models.User", "User") + .WithMany("UserRoles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); #pragma warning restore 612, 618 } } diff --git a/api/Migrations/20190214202719_nova.cs b/api/Migrations/20190214202719_nova.cs new file mode 100644 index 00000000..064e2c4f --- /dev/null +++ b/api/Migrations/20190214202719_nova.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace api.Migrations +{ + public partial class nova : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + + } + } +} diff --git a/api/Migrations/DataContextModelSnapshot.cs b/api/Migrations/DataContextModelSnapshot.cs old mode 100755 new mode 100644 index bd11d6b2..3d13166c --- a/api/Migrations/DataContextModelSnapshot.cs +++ b/api/Migrations/DataContextModelSnapshot.cs @@ -14,7 +14,76 @@ namespace api.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "2.1.4-rtm-31024"); + .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("RoleId"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClaimType"); + + b.Property("ClaimValue"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider"); + + b.Property("ProviderKey"); + + b.Property("ProviderDisplayName"); + + b.Property("UserId"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId"); + + b.Property("LoginProvider"); + + b.Property("Name"); + + b.Property("Value"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); modelBuilder.Entity("api.Models.EventQR", b => { @@ -110,36 +179,16 @@ namespace api.Migrations b.Property("Id") .ValueGeneratedOnAdd(); - b.Property("About"); - b.Property("AccessFailedCount"); - b.Property("Adress"); - - b.Property("Age"); - - b.Property("City"); - - b.Property("Company"); - b.Property("ConcurrencyStamp") .IsConcurrencyToken(); - b.Property("Country"); - - b.Property("Degree"); - b.Property("Email") .HasMaxLength(256); b.Property("EmailConfirmed"); - b.Property("FullName"); - - b.Property("Gender"); - - b.Property("LastLogin"); - b.Property("LockoutEnabled"); b.Property("LockoutEnd"); @@ -152,37 +201,21 @@ namespace api.Migrations b.Property("PasswordHash"); - b.Property("Phone"); - b.Property("PhoneNumber"); b.Property("PhoneNumberConfirmed"); - b.Property("Position"); - - b.Property("ProfileIcon"); - b.Property("QRcode"); - b.Property("Registed"); - - b.Property("Role"); - - b.Property("SchoolYear"); - b.Property("SecurityStamp"); b.Property("TeamId"); b.Property("TwoFactorEnabled"); - b.Property("University"); - b.Property("UserName") .HasMaxLength(256); - b.Property("linkedIn"); - b.HasKey("Id"); b.HasIndex("NormalizedEmail") @@ -224,70 +257,34 @@ namespace api.Migrations modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("RoleId"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); + b.HasOne("api.Models.Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("ClaimType"); - - b.Property("ClaimValue"); - - b.Property("UserId"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); + b.HasOne("api.Models.User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { - b.Property("LoginProvider"); - - b.Property("ProviderKey"); - - b.Property("ProviderDisplayName"); - - b.Property("UserId"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); + b.HasOne("api.Models.User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { - b.Property("UserId"); - - b.Property("LoginProvider"); - - b.Property("Name"); - - b.Property("Value"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); + b.HasOne("api.Models.User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); }); modelBuilder.Entity("api.Models.EventQR", b => @@ -325,38 +322,6 @@ namespace api.Migrations .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade); }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.HasOne("api.Models.Role") - .WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.HasOne("api.Models.User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("api.Models.User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("api.Models.User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); #pragma warning restore 612, 618 } } diff --git a/api/Models/User.cs b/api/Models/User.cs index 37b54a15..8b9f10f0 100755 --- a/api/Models/User.cs +++ b/api/Models/User.cs @@ -7,26 +7,7 @@ namespace api.Models { public class User: IdentityUser { - - public string FullName {get;set;} - public string Gender {get;set;} - public int Age{get;set;} - public int Phone{get;set;} - public string University{get;set;} - public string Adress{get;set;} - public string Country{get;set;} - public string City{get;set;} - public string linkedIn{get;set;} - public DateTime LastLogin {get;set;} - public DateTime Registed{get;set;} public string QRcode{get;set;} - public string Role{get;set;} - public string Degree{get;set;} - public int SchoolYear{get;set;} - public string ProfileIcon {get;set;} - public string Company{get;set;} - public string Position{get;set;} - public string About{get;set;} public ICollection UserRoles{get;set;} public ICollection Photos {get;set;} diff --git a/api/obj/Debug/netcoreapp2.1/api.assets.cache b/api/obj/Debug/netcoreapp2.1/api.assets.cache index e445080c..b5b8a63c 100644 Binary files a/api/obj/Debug/netcoreapp2.1/api.assets.cache and b/api/obj/Debug/netcoreapp2.1/api.assets.cache differ diff --git a/api/obj/Debug/netcoreapp2.1/project.razor.json b/api/obj/Debug/netcoreapp2.1/project.razor.json index 2ba5fb94..d0f0bc73 100644 --- a/api/obj/Debug/netcoreapp2.1/project.razor.json +++ b/api/obj/Debug/netcoreapp2.1/project.razor.json @@ -1,14 +1,14 @@ -{ - "ProjectFilePath": "c:\\Users\\ZMiguel\\Desktop\\ENEI2019\\api\\api.csproj", - "TargetFramework": "netcoreapp2.1", - "TagHelpers": [], - "Configuration": { - "ConfigurationName": "MVC-2.1", - "LanguageVersion": "2.1", - "Extensions": [ - { - "ExtensionName": "MVC-2.1" - } - ] - } +{ + "ProjectFilePath": "/Users/henrique/ENEI2019/api/api.csproj", + "TargetFramework": "netcoreapp2.1", + "TagHelpers": [], + "Configuration": { + "ConfigurationName": "MVC-2.1", + "LanguageVersion": "2.1", + "Extensions": [ + { + "ExtensionName": "MVC-2.1" + } + ] + } } \ No newline at end of file