commit 5f000cb08c45978f6ec920f2f76f2362a378b2bb
Author: Vojtěch Bartička <aitakaitov@gmail.com>
Date:   Tue May 17 19:52:24 2022 +0200

    Added database migration

diff --git a/Backend/Backend/Migrations/20220330142537_v1.Designer.cs b/Backend/Backend/Migrations/20220330142537_v1.Designer.cs
deleted file mode 100644
index 1208fe3..0000000
--- a/Backend/Backend/Migrations/20220330142537_v1.Designer.cs
+++ /dev/null
@@ -1,407 +0,0 @@
-﻿// <auto-generated />
-using System;
-using Core.Contexts;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace RestAPI.Migrations
-{
-    [DbContext(typeof(DatabaseContext))]
-    [Migration("20220330142537_v1")]
-    partial class v1
-    {
-        protected override void BuildTargetModel(ModelBuilder modelBuilder)
-        {
-#pragma warning disable 612, 618
-            modelBuilder
-                .HasAnnotation("ProductVersion", "6.0.3")
-                .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
-            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
-            modelBuilder.Entity("AnnotationClass", b =>
-                {
-                    b.Property<Guid>("AnnotationsId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("ClassesId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("AnnotationsId", "ClassesId");
-
-                    b.HasIndex("ClassesId");
-
-                    b.ToTable("AnnotationClass");
-                });
-
-            modelBuilder.Entity("Core.Entities.Annotation", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<DateTime>("DateAssigned")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<DateTime>("DateLastChanged")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<Guid>("DocumentId")
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Note")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("State")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid>("UserAssignedId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("UserId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("DocumentId");
-
-                    b.HasIndex("UserAssignedId");
-
-                    b.HasIndex("UserId");
-
-                    b.ToTable("Annotations");
-                });
-
-            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("AnnotationId")
-                        .HasColumnType("uuid");
-
-                    b.Property<int>("Instance")
-                        .HasColumnType("integer");
-
-                    b.Property<int>("Length")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Note")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("Position")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid?>("SubTagId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("TagId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("AnnotationId");
-
-                    b.HasIndex("SubTagId");
-
-                    b.HasIndex("TagId");
-
-                    b.ToTable("AnnotationTags");
-                });
-
-            modelBuilder.Entity("Core.Entities.Class", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Classes");
-                });
-
-            modelBuilder.Entity("Core.Entities.Document", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("ContentId")
-                        .HasColumnType("uuid");
-
-                    b.Property<DateTime>("DateAdded")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<int>("Length")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("RequiredAnnotations")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid>("UserAddedId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("ContentId");
-
-                    b.HasIndex("UserAddedId");
-
-                    b.ToTable("Documents");
-                });
-
-            modelBuilder.Entity("Core.Entities.DocumentContent", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Content")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("DocumentContents");
-                });
-
-            modelBuilder.Entity("Core.Entities.SubTag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<Guid>("TagId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("TagId");
-
-                    b.ToTable("SubTags");
-                });
-
-            modelBuilder.Entity("Core.Entities.Tag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("CategoryId")
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("CategoryId");
-
-                    b.ToTable("Tags");
-                });
-
-            modelBuilder.Entity("Core.Entities.TagCategory", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("TagCategories");
-                });
-
-            modelBuilder.Entity("Core.Entities.User", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Password")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("Role")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Surname")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Username")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Users");
-                });
-
-            modelBuilder.Entity("AnnotationClass", b =>
-                {
-                    b.HasOne("Core.Entities.Annotation", null)
-                        .WithMany()
-                        .HasForeignKey("AnnotationsId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.Class", null)
-                        .WithMany()
-                        .HasForeignKey("ClassesId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Core.Entities.Annotation", b =>
-                {
-                    b.HasOne("Core.Entities.Document", "Document")
-                        .WithMany()
-                        .HasForeignKey("DocumentId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "UserAssigned")
-                        .WithMany()
-                        .HasForeignKey("UserAssignedId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "User")
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Document");
-
-                    b.Navigation("User");
-
-                    b.Navigation("UserAssigned");
-                });
-
-            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
-                {
-                    b.HasOne("Core.Entities.Annotation", "Annotation")
-                        .WithMany()
-                        .HasForeignKey("AnnotationId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.SubTag", "SubTag")
-                        .WithMany()
-                        .HasForeignKey("SubTagId");
-
-                    b.HasOne("Core.Entities.Tag", "Tag")
-                        .WithMany()
-                        .HasForeignKey("TagId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Annotation");
-
-                    b.Navigation("SubTag");
-
-                    b.Navigation("Tag");
-                });
-
-            modelBuilder.Entity("Core.Entities.Document", b =>
-                {
-                    b.HasOne("Core.Entities.DocumentContent", "Content")
-                        .WithMany()
-                        .HasForeignKey("ContentId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "UserAdded")
-                        .WithMany()
-                        .HasForeignKey("UserAddedId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Content");
-
-                    b.Navigation("UserAdded");
-                });
-
-            modelBuilder.Entity("Core.Entities.SubTag", b =>
-                {
-                    b.HasOne("Core.Entities.Tag", "Tag")
-                        .WithMany()
-                        .HasForeignKey("TagId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Tag");
-                });
-
-            modelBuilder.Entity("Core.Entities.Tag", b =>
-                {
-                    b.HasOne("Core.Entities.TagCategory", "Category")
-                        .WithMany()
-                        .HasForeignKey("CategoryId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Category");
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}
diff --git a/Backend/Backend/Migrations/20220330142537_v1.cs b/Backend/Backend/Migrations/20220330142537_v1.cs
deleted file mode 100644
index ebbbf1a..0000000
--- a/Backend/Backend/Migrations/20220330142537_v1.cs
+++ /dev/null
@@ -1,322 +0,0 @@
-﻿using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace RestAPI.Migrations
-{
-    public partial class v1 : Migration
-    {
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(
-                name: "Classes",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Name = table.Column<string>(type: "text", nullable: false),
-                    Description = table.Column<string>(type: "text", nullable: false),
-                    Color = table.Column<string>(type: "text", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Classes", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "DocumentContents",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Content = table.Column<string>(type: "text", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_DocumentContents", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "TagCategories",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Name = table.Column<string>(type: "text", nullable: false),
-                    Color = table.Column<string>(type: "text", nullable: false),
-                    Description = table.Column<string>(type: "text", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_TagCategories", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Users",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Username = table.Column<string>(type: "text", nullable: false),
-                    Password = table.Column<string>(type: "text", nullable: false),
-                    Name = table.Column<string>(type: "text", nullable: false),
-                    Surname = table.Column<string>(type: "text", nullable: false),
-                    Role = table.Column<int>(type: "integer", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Users", x => x.Id);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Tags",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    CategoryId = table.Column<Guid>(type: "uuid", nullable: false),
-                    Name = table.Column<string>(type: "text", nullable: false),
-                    Description = table.Column<string>(type: "text", nullable: false),
-                    Color = table.Column<string>(type: "text", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Tags", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_Tags_TagCategories_CategoryId",
-                        column: x => x.CategoryId,
-                        principalTable: "TagCategories",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Documents",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Name = table.Column<string>(type: "text", nullable: false),
-                    Length = table.Column<int>(type: "integer", nullable: false),
-                    ContentId = table.Column<Guid>(type: "uuid", nullable: false),
-                    DateAdded = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
-                    UserAddedId = table.Column<Guid>(type: "uuid", nullable: false),
-                    RequiredAnnotations = table.Column<int>(type: "integer", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Documents", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_Documents_DocumentContents_ContentId",
-                        column: x => x.ContentId,
-                        principalTable: "DocumentContents",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_Documents_Users_UserAddedId",
-                        column: x => x.UserAddedId,
-                        principalTable: "Users",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "SubTags",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Name = table.Column<string>(type: "text", nullable: false),
-                    Description = table.Column<string>(type: "text", nullable: false),
-                    TagId = table.Column<Guid>(type: "uuid", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_SubTags", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_SubTags_Tags_TagId",
-                        column: x => x.TagId,
-                        principalTable: "Tags",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "Annotations",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    DocumentId = table.Column<Guid>(type: "uuid", nullable: false),
-                    UserId = table.Column<Guid>(type: "uuid", nullable: false),
-                    UserAssignedId = table.Column<Guid>(type: "uuid", nullable: false),
-                    DateAssigned = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
-                    State = table.Column<int>(type: "integer", nullable: false),
-                    DateLastChanged = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
-                    Note = table.Column<string>(type: "text", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_Annotations", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_Annotations_Documents_DocumentId",
-                        column: x => x.DocumentId,
-                        principalTable: "Documents",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_Annotations_Users_UserAssignedId",
-                        column: x => x.UserAssignedId,
-                        principalTable: "Users",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_Annotations_Users_UserId",
-                        column: x => x.UserId,
-                        principalTable: "Users",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AnnotationClass",
-                columns: table => new
-                {
-                    AnnotationsId = table.Column<Guid>(type: "uuid", nullable: false),
-                    ClassesId = table.Column<Guid>(type: "uuid", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AnnotationClass", x => new { x.AnnotationsId, x.ClassesId });
-                    table.ForeignKey(
-                        name: "FK_AnnotationClass_Annotations_AnnotationsId",
-                        column: x => x.AnnotationsId,
-                        principalTable: "Annotations",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_AnnotationClass_Classes_ClassesId",
-                        column: x => x.ClassesId,
-                        principalTable: "Classes",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateTable(
-                name: "AnnotationTags",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    AnnotationId = table.Column<Guid>(type: "uuid", nullable: false),
-                    TagId = table.Column<Guid>(type: "uuid", nullable: false),
-                    SubTagId = table.Column<Guid>(type: "uuid", nullable: true),
-                    Instance = table.Column<int>(type: "integer", nullable: false),
-                    Note = table.Column<string>(type: "text", nullable: false),
-                    Position = table.Column<int>(type: "integer", nullable: false),
-                    Length = table.Column<int>(type: "integer", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_AnnotationTags", x => x.Id);
-                    table.ForeignKey(
-                        name: "FK_AnnotationTags_Annotations_AnnotationId",
-                        column: x => x.AnnotationId,
-                        principalTable: "Annotations",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                    table.ForeignKey(
-                        name: "FK_AnnotationTags_SubTags_SubTagId",
-                        column: x => x.SubTagId,
-                        principalTable: "SubTags",
-                        principalColumn: "Id");
-                    table.ForeignKey(
-                        name: "FK_AnnotationTags_Tags_TagId",
-                        column: x => x.TagId,
-                        principalTable: "Tags",
-                        principalColumn: "Id",
-                        onDelete: ReferentialAction.Cascade);
-                });
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AnnotationClass_ClassesId",
-                table: "AnnotationClass",
-                column: "ClassesId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Annotations_DocumentId",
-                table: "Annotations",
-                column: "DocumentId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Annotations_UserAssignedId",
-                table: "Annotations",
-                column: "UserAssignedId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Annotations_UserId",
-                table: "Annotations",
-                column: "UserId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AnnotationTags_AnnotationId",
-                table: "AnnotationTags",
-                column: "AnnotationId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AnnotationTags_SubTagId",
-                table: "AnnotationTags",
-                column: "SubTagId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_AnnotationTags_TagId",
-                table: "AnnotationTags",
-                column: "TagId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Documents_ContentId",
-                table: "Documents",
-                column: "ContentId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Documents_UserAddedId",
-                table: "Documents",
-                column: "UserAddedId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_SubTags_TagId",
-                table: "SubTags",
-                column: "TagId");
-
-            migrationBuilder.CreateIndex(
-                name: "IX_Tags_CategoryId",
-                table: "Tags",
-                column: "CategoryId");
-        }
-
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "AnnotationClass");
-
-            migrationBuilder.DropTable(
-                name: "AnnotationTags");
-
-            migrationBuilder.DropTable(
-                name: "Classes");
-
-            migrationBuilder.DropTable(
-                name: "Annotations");
-
-            migrationBuilder.DropTable(
-                name: "SubTags");
-
-            migrationBuilder.DropTable(
-                name: "Documents");
-
-            migrationBuilder.DropTable(
-                name: "Tags");
-
-            migrationBuilder.DropTable(
-                name: "DocumentContents");
-
-            migrationBuilder.DropTable(
-                name: "Users");
-
-            migrationBuilder.DropTable(
-                name: "TagCategories");
-        }
-    }
-}
diff --git a/Backend/Backend/Migrations/20220417114429_V3.Designer.cs b/Backend/Backend/Migrations/20220417114429_V3.Designer.cs
deleted file mode 100644
index 8601f5d..0000000
--- a/Backend/Backend/Migrations/20220417114429_V3.Designer.cs
+++ /dev/null
@@ -1,395 +0,0 @@
-﻿// <auto-generated />
-using System;
-using Core.Contexts;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace RestAPI.Migrations
-{
-    [DbContext(typeof(DatabaseContext))]
-    [Migration("20220417114429_V3")]
-    partial class V3
-    {
-        protected override void BuildTargetModel(ModelBuilder modelBuilder)
-        {
-#pragma warning disable 612, 618
-            modelBuilder
-                .HasAnnotation("ProductVersion", "6.0.3")
-                .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
-            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
-            modelBuilder.Entity("AnnotationClass", b =>
-                {
-                    b.Property<Guid>("AnnotationsId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("ClassesId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("AnnotationsId", "ClassesId");
-
-                    b.HasIndex("ClassesId");
-
-                    b.ToTable("AnnotationClass");
-                });
-
-            modelBuilder.Entity("Core.Entities.Annotation", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<DateTime>("DateAssigned")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<DateTime>("DateLastChanged")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<Guid>("DocumentId")
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Note")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("State")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid>("UserAssignedId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("UserId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("DocumentId");
-
-                    b.HasIndex("UserAssignedId");
-
-                    b.HasIndex("UserId");
-
-                    b.ToTable("Annotations");
-                });
-
-            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("AnnotationId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("Instance")
-                        .HasColumnType("uuid");
-
-                    b.Property<int>("Length")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Note")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("Position")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid?>("SubTagId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("TagId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("AnnotationId");
-
-                    b.HasIndex("SubTagId");
-
-                    b.HasIndex("TagId");
-
-                    b.ToTable("AnnotationTags");
-                });
-
-            modelBuilder.Entity("Core.Entities.Class", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Classes");
-                });
-
-            modelBuilder.Entity("Core.Entities.Document", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid?>("ContentId")
-                        .HasColumnType("uuid");
-
-                    b.Property<DateTime>("DateAdded")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<int>("Length")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("text");
-
-                    b.Property<int>("RequiredAnnotations")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid?>("UserAddedId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("ContentId");
-
-                    b.HasIndex("UserAddedId");
-
-                    b.ToTable("Documents");
-                });
-
-            modelBuilder.Entity("Core.Entities.DocumentContent", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Content")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("DocumentContents");
-                });
-
-            modelBuilder.Entity("Core.Entities.SubTag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<Guid>("TagId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("TagId");
-
-                    b.ToTable("SubTags");
-                });
-
-            modelBuilder.Entity("Core.Entities.Tag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("CategoryId")
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("CategoryId");
-
-                    b.ToTable("Tags");
-                });
-
-            modelBuilder.Entity("Core.Entities.TagCategory", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("TagCategories");
-                });
-
-            modelBuilder.Entity("Core.Entities.User", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Password")
-                        .HasColumnType("text");
-
-                    b.Property<int>("Role")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Surname")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Username")
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Users");
-                });
-
-            modelBuilder.Entity("AnnotationClass", b =>
-                {
-                    b.HasOne("Core.Entities.Annotation", null)
-                        .WithMany()
-                        .HasForeignKey("AnnotationsId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.Class", null)
-                        .WithMany()
-                        .HasForeignKey("ClassesId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Core.Entities.Annotation", b =>
-                {
-                    b.HasOne("Core.Entities.Document", "Document")
-                        .WithMany()
-                        .HasForeignKey("DocumentId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "UserAssigned")
-                        .WithMany()
-                        .HasForeignKey("UserAssignedId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "User")
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Document");
-
-                    b.Navigation("User");
-
-                    b.Navigation("UserAssigned");
-                });
-
-            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
-                {
-                    b.HasOne("Core.Entities.Annotation", "Annotation")
-                        .WithMany()
-                        .HasForeignKey("AnnotationId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.SubTag", "SubTag")
-                        .WithMany()
-                        .HasForeignKey("SubTagId");
-
-                    b.HasOne("Core.Entities.Tag", "Tag")
-                        .WithMany()
-                        .HasForeignKey("TagId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Annotation");
-
-                    b.Navigation("SubTag");
-
-                    b.Navigation("Tag");
-                });
-
-            modelBuilder.Entity("Core.Entities.Document", b =>
-                {
-                    b.HasOne("Core.Entities.DocumentContent", "Content")
-                        .WithMany()
-                        .HasForeignKey("ContentId");
-
-                    b.HasOne("Core.Entities.User", "UserAdded")
-                        .WithMany()
-                        .HasForeignKey("UserAddedId");
-
-                    b.Navigation("Content");
-
-                    b.Navigation("UserAdded");
-                });
-
-            modelBuilder.Entity("Core.Entities.SubTag", b =>
-                {
-                    b.HasOne("Core.Entities.Tag", "Tag")
-                        .WithMany()
-                        .HasForeignKey("TagId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Tag");
-                });
-
-            modelBuilder.Entity("Core.Entities.Tag", b =>
-                {
-                    b.HasOne("Core.Entities.TagCategory", "Category")
-                        .WithMany()
-                        .HasForeignKey("CategoryId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Category");
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}
diff --git a/Backend/Backend/Migrations/20220417114429_V3.cs b/Backend/Backend/Migrations/20220417114429_V3.cs
deleted file mode 100644
index aecbffb..0000000
--- a/Backend/Backend/Migrations/20220417114429_V3.cs
+++ /dev/null
@@ -1,258 +0,0 @@
-﻿using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace RestAPI.Migrations
-{
-    public partial class V3 : Migration
-    {
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropForeignKey(
-                name: "FK_Documents_DocumentContents_ContentId",
-                table: "Documents");
-
-            migrationBuilder.DropForeignKey(
-                name: "FK_Documents_Users_UserAddedId",
-                table: "Documents");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Username",
-                table: "Users",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Surname",
-                table: "Users",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Password",
-                table: "Users",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Name",
-                table: "Users",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Name",
-                table: "TagCategories",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Description",
-                table: "TagCategories",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Color",
-                table: "TagCategories",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<Guid>(
-                name: "UserAddedId",
-                table: "Documents",
-                type: "uuid",
-                nullable: true,
-                oldClrType: typeof(Guid),
-                oldType: "uuid");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Name",
-                table: "Documents",
-                type: "text",
-                nullable: true,
-                oldClrType: typeof(string),
-                oldType: "text");
-
-            migrationBuilder.AlterColumn<Guid>(
-                name: "ContentId",
-                table: "Documents",
-                type: "uuid",
-                nullable: true,
-                oldClrType: typeof(Guid),
-                oldType: "uuid");
-
-            migrationBuilder.AlterColumn<Guid>(
-                name: "Instance",
-                table: "AnnotationTags",
-                type: "uuid",
-                nullable: false,
-                oldClrType: typeof(int),
-                oldType: "integer");
-
-            migrationBuilder.AddForeignKey(
-                name: "FK_Documents_DocumentContents_ContentId",
-                table: "Documents",
-                column: "ContentId",
-                principalTable: "DocumentContents",
-                principalColumn: "Id");
-
-            migrationBuilder.AddForeignKey(
-                name: "FK_Documents_Users_UserAddedId",
-                table: "Documents",
-                column: "UserAddedId",
-                principalTable: "Users",
-                principalColumn: "Id");
-        }
-
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropForeignKey(
-                name: "FK_Documents_DocumentContents_ContentId",
-                table: "Documents");
-
-            migrationBuilder.DropForeignKey(
-                name: "FK_Documents_Users_UserAddedId",
-                table: "Documents");
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Username",
-                table: "Users",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Surname",
-                table: "Users",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Password",
-                table: "Users",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Name",
-                table: "Users",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Name",
-                table: "TagCategories",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Description",
-                table: "TagCategories",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Color",
-                table: "TagCategories",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<Guid>(
-                name: "UserAddedId",
-                table: "Documents",
-                type: "uuid",
-                nullable: false,
-                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
-                oldClrType: typeof(Guid),
-                oldType: "uuid",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<string>(
-                name: "Name",
-                table: "Documents",
-                type: "text",
-                nullable: false,
-                defaultValue: "",
-                oldClrType: typeof(string),
-                oldType: "text",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<Guid>(
-                name: "ContentId",
-                table: "Documents",
-                type: "uuid",
-                nullable: false,
-                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
-                oldClrType: typeof(Guid),
-                oldType: "uuid",
-                oldNullable: true);
-
-            migrationBuilder.AlterColumn<int>(
-                name: "Instance",
-                table: "AnnotationTags",
-                type: "integer",
-                nullable: false,
-                oldClrType: typeof(Guid),
-                oldType: "uuid");
-
-            migrationBuilder.AddForeignKey(
-                name: "FK_Documents_DocumentContents_ContentId",
-                table: "Documents",
-                column: "ContentId",
-                principalTable: "DocumentContents",
-                principalColumn: "Id",
-                onDelete: ReferentialAction.Cascade);
-
-            migrationBuilder.AddForeignKey(
-                name: "FK_Documents_Users_UserAddedId",
-                table: "Documents",
-                column: "UserAddedId",
-                principalTable: "Users",
-                principalColumn: "Id",
-                onDelete: ReferentialAction.Cascade);
-        }
-    }
-}
diff --git a/Backend/Backend/Migrations/20220427093145_V4.Designer.cs b/Backend/Backend/Migrations/20220427093145_V4.Designer.cs
deleted file mode 100644
index eaa1983..0000000
--- a/Backend/Backend/Migrations/20220427093145_V4.Designer.cs
+++ /dev/null
@@ -1,414 +0,0 @@
-﻿// <auto-generated />
-using System;
-using Core.Contexts;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace RestAPI.Migrations
-{
-    [DbContext(typeof(DatabaseContext))]
-    [Migration("20220427093145_V4")]
-    partial class V4
-    {
-        protected override void BuildTargetModel(ModelBuilder modelBuilder)
-        {
-#pragma warning disable 612, 618
-            modelBuilder
-                .HasAnnotation("ProductVersion", "6.0.3")
-                .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
-            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
-            modelBuilder.Entity("AnnotationClass", b =>
-                {
-                    b.Property<Guid>("AnnotationsId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("ClassesId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("AnnotationsId", "ClassesId");
-
-                    b.HasIndex("ClassesId");
-
-                    b.ToTable("AnnotationClass");
-                });
-
-            modelBuilder.Entity("Core.Entities.Annotation", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<DateTime>("DateAssigned")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<DateTime>("DateLastChanged")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<Guid>("DocumentId")
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Note")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("State")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid>("UserAssignedId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("UserId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("DocumentId");
-
-                    b.HasIndex("UserAssignedId");
-
-                    b.HasIndex("UserId");
-
-                    b.ToTable("Annotations");
-                });
-
-            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("AnnotationId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("Instance")
-                        .HasColumnType("uuid");
-
-                    b.Property<int>("Length")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Note")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<int>("Position")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid?>("SubTagId")
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("TagId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("AnnotationId");
-
-                    b.HasIndex("SubTagId");
-
-                    b.HasIndex("TagId");
-
-                    b.ToTable("AnnotationTags");
-                });
-
-            modelBuilder.Entity("Core.Entities.Class", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Classes");
-                });
-
-            modelBuilder.Entity("Core.Entities.ConfigurationItem", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Key")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Value")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("ConfigurationItems");
-                });
-
-            modelBuilder.Entity("Core.Entities.Document", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid?>("ContentId")
-                        .HasColumnType("uuid");
-
-                    b.Property<DateTime>("DateAdded")
-                        .HasColumnType("timestamp with time zone");
-
-                    b.Property<int>("Length")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("text");
-
-                    b.Property<int>("RequiredAnnotations")
-                        .HasColumnType("integer");
-
-                    b.Property<Guid?>("UserAddedId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("ContentId");
-
-                    b.HasIndex("UserAddedId");
-
-                    b.ToTable("Documents");
-                });
-
-            modelBuilder.Entity("Core.Entities.DocumentContent", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Content")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("DocumentContents");
-                });
-
-            modelBuilder.Entity("Core.Entities.SubTag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<Guid>("TagId")
-                        .HasColumnType("uuid");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("TagId");
-
-                    b.ToTable("SubTags");
-                });
-
-            modelBuilder.Entity("Core.Entities.Tag", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<Guid>("CategoryId")
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .IsRequired()
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.HasIndex("CategoryId");
-
-                    b.ToTable("Tags");
-                });
-
-            modelBuilder.Entity("Core.Entities.TagCategory", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Color")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Description")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("TagCategories");
-                });
-
-            modelBuilder.Entity("Core.Entities.User", b =>
-                {
-                    b.Property<Guid>("Id")
-                        .ValueGeneratedOnAdd()
-                        .HasColumnType("uuid");
-
-                    b.Property<string>("Name")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Password")
-                        .HasColumnType("text");
-
-                    b.Property<int>("Role")
-                        .HasColumnType("integer");
-
-                    b.Property<string>("Surname")
-                        .HasColumnType("text");
-
-                    b.Property<string>("Username")
-                        .HasColumnType("text");
-
-                    b.HasKey("Id");
-
-                    b.ToTable("Users");
-                });
-
-            modelBuilder.Entity("AnnotationClass", b =>
-                {
-                    b.HasOne("Core.Entities.Annotation", null)
-                        .WithMany()
-                        .HasForeignKey("AnnotationsId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.Class", null)
-                        .WithMany()
-                        .HasForeignKey("ClassesId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-                });
-
-            modelBuilder.Entity("Core.Entities.Annotation", b =>
-                {
-                    b.HasOne("Core.Entities.Document", "Document")
-                        .WithMany()
-                        .HasForeignKey("DocumentId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "UserAssigned")
-                        .WithMany()
-                        .HasForeignKey("UserAssignedId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.User", "User")
-                        .WithMany()
-                        .HasForeignKey("UserId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Document");
-
-                    b.Navigation("User");
-
-                    b.Navigation("UserAssigned");
-                });
-
-            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
-                {
-                    b.HasOne("Core.Entities.Annotation", "Annotation")
-                        .WithMany()
-                        .HasForeignKey("AnnotationId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.HasOne("Core.Entities.SubTag", "SubTag")
-                        .WithMany()
-                        .HasForeignKey("SubTagId");
-
-                    b.HasOne("Core.Entities.Tag", "Tag")
-                        .WithMany()
-                        .HasForeignKey("TagId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Annotation");
-
-                    b.Navigation("SubTag");
-
-                    b.Navigation("Tag");
-                });
-
-            modelBuilder.Entity("Core.Entities.Document", b =>
-                {
-                    b.HasOne("Core.Entities.DocumentContent", "Content")
-                        .WithMany()
-                        .HasForeignKey("ContentId");
-
-                    b.HasOne("Core.Entities.User", "UserAdded")
-                        .WithMany()
-                        .HasForeignKey("UserAddedId");
-
-                    b.Navigation("Content");
-
-                    b.Navigation("UserAdded");
-                });
-
-            modelBuilder.Entity("Core.Entities.SubTag", b =>
-                {
-                    b.HasOne("Core.Entities.Tag", "Tag")
-                        .WithMany()
-                        .HasForeignKey("TagId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Tag");
-                });
-
-            modelBuilder.Entity("Core.Entities.Tag", b =>
-                {
-                    b.HasOne("Core.Entities.TagCategory", "Category")
-                        .WithMany()
-                        .HasForeignKey("CategoryId")
-                        .OnDelete(DeleteBehavior.Cascade)
-                        .IsRequired();
-
-                    b.Navigation("Category");
-                });
-#pragma warning restore 612, 618
-        }
-    }
-}
diff --git a/Backend/Backend/Migrations/20220427093145_V4.cs b/Backend/Backend/Migrations/20220427093145_V4.cs
deleted file mode 100644
index 1b28fea..0000000
--- a/Backend/Backend/Migrations/20220427093145_V4.cs
+++ /dev/null
@@ -1,32 +0,0 @@
-﻿using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace RestAPI.Migrations
-{
-    public partial class V4 : Migration
-    {
-        protected override void Up(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.CreateTable(
-                name: "ConfigurationItems",
-                columns: table => new
-                {
-                    Id = table.Column<Guid>(type: "uuid", nullable: false),
-                    Value = table.Column<string>(type: "text", nullable: false),
-                    Key = table.Column<string>(type: "text", nullable: false)
-                },
-                constraints: table =>
-                {
-                    table.PrimaryKey("PK_ConfigurationItems", x => x.Id);
-                });
-        }
-
-        protected override void Down(MigrationBuilder migrationBuilder)
-        {
-            migrationBuilder.DropTable(
-                name: "ConfigurationItems");
-        }
-    }
-}
diff --git a/Backend/Backend/Migrations/20220517175136_V1.Designer.cs b/Backend/Backend/Migrations/20220517175136_V1.Designer.cs
new file mode 100644
index 0000000..8e61cc1
--- /dev/null
+++ b/Backend/Backend/Migrations/20220517175136_V1.Designer.cs
@@ -0,0 +1,607 @@
+﻿// <auto-generated />
+using System;
+using Core.Contexts;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace RestAPI.Migrations
+{
+    [DbContext(typeof(DatabaseContext))]
+    [Migration("20220517175136_V1")]
+    partial class V1
+    {
+        protected override void BuildTargetModel(ModelBuilder modelBuilder)
+        {
+#pragma warning disable 612, 618
+            modelBuilder
+                .HasAnnotation("ProductVersion", "6.0.3")
+                .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+            NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
+
+            modelBuilder.Entity("AnnotationClass", b =>
+                {
+                    b.Property<Guid>("AnnotationsId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("ClassesId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("AnnotationsId", "ClassesId");
+
+                    b.HasIndex("ClassesId");
+
+                    b.ToTable("AnnotationClass");
+                });
+
+            modelBuilder.Entity("AnnotationFinalAnnotation", b =>
+                {
+                    b.Property<Guid>("AnnotationsId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("FinalAnnotationsId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("AnnotationsId", "FinalAnnotationsId");
+
+                    b.HasIndex("FinalAnnotationsId");
+
+                    b.ToTable("AnnotationFinalAnnotation");
+                });
+
+            modelBuilder.Entity("Core.Entities.Annotation", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("CachedCSS")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedClosingLengths")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedClosingPositions")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedDocumentHTML")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedLengths")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedStartPositions")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<DateTime>("DateAssigned")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.Property<DateTime>("DateLastChanged")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.Property<string>("Discriminator")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<Guid>("DocumentId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid?>("LastModifiedTagId")
+                        .HasColumnType("uuid");
+
+                    b.Property<int>("ModifiedType")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("Note")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("State")
+                        .HasColumnType("integer");
+
+                    b.Property<Guid>("UserAssignedId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("UserId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("DocumentId");
+
+                    b.HasIndex("UserAssignedId");
+
+                    b.HasIndex("UserId");
+
+                    b.ToTable("Annotations");
+
+                    b.HasDiscriminator<string>("Discriminator").HasValue("Annotation");
+                });
+
+            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("AnnotationId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("Instance")
+                        .HasColumnType("uuid");
+
+                    b.Property<int>("Length")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("Note")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("Position")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("SelectedText")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("Sentiment")
+                        .HasColumnType("integer");
+
+                    b.Property<Guid?>("SubTagId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("TagId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AnnotationId");
+
+                    b.HasIndex("SubTagId");
+
+                    b.HasIndex("TagId");
+
+                    b.ToTable("AnnotationTags");
+                });
+
+            modelBuilder.Entity("Core.Entities.Class", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Color")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Description")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Classes");
+                });
+
+            modelBuilder.Entity("Core.Entities.ConfigurationItem", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Key")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Value")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("ConfigurationItems");
+                });
+
+            modelBuilder.Entity("Core.Entities.Document", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid?>("ContentId")
+                        .HasColumnType("uuid");
+
+                    b.Property<DateTime>("DateAdded")
+                        .HasColumnType("timestamp with time zone");
+
+                    b.Property<int>("Length")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("Name")
+                        .HasColumnType("text");
+
+                    b.Property<int>("RequiredAnnotations")
+                        .HasColumnType("integer");
+
+                    b.Property<Guid?>("UserAddedId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("ContentId");
+
+                    b.HasIndex("UserAddedId");
+
+                    b.ToTable("Documents");
+                });
+
+            modelBuilder.Entity("Core.Entities.DocumentContent", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Content")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("DocumentContents");
+                });
+
+            modelBuilder.Entity("Core.Entities.FinalAnnotationTag", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("AnnotationId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("Instance")
+                        .HasColumnType("uuid");
+
+                    b.Property<bool>("IsFinal")
+                        .HasColumnType("boolean");
+
+                    b.Property<int>("Length")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("Note")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("Position")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("SelectedText")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("Sentiment")
+                        .HasColumnType("integer");
+
+                    b.Property<Guid?>("SubTagId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("TagId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AnnotationId");
+
+                    b.HasIndex("SubTagId");
+
+                    b.HasIndex("TagId");
+
+                    b.ToTable("FinalAnnotationTags");
+                });
+
+            modelBuilder.Entity("Core.Entities.SubTag", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Description")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<bool>("SentimentEnabled")
+                        .HasColumnType("boolean");
+
+                    b.Property<Guid>("TagId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("TagId");
+
+                    b.ToTable("SubTags");
+                });
+
+            modelBuilder.Entity("Core.Entities.Tag", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("CategoryId")
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Color")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Description")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("Name")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<bool>("SentimentEnabled")
+                        .HasColumnType("boolean");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("CategoryId");
+
+                    b.ToTable("Tags");
+                });
+
+            modelBuilder.Entity("Core.Entities.TagCategory", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Color")
+                        .HasColumnType("text");
+
+                    b.Property<string>("Description")
+                        .HasColumnType("text");
+
+                    b.Property<bool>("DisabledForAnnotators")
+                        .HasColumnType("boolean");
+
+                    b.Property<string>("Name")
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("TagCategories");
+                });
+
+            modelBuilder.Entity("Core.Entities.User", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<string>("Name")
+                        .HasColumnType("text");
+
+                    b.Property<string>("Password")
+                        .HasColumnType("text");
+
+                    b.Property<int>("Role")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("Surname")
+                        .HasColumnType("text");
+
+                    b.Property<string>("Username")
+                        .HasColumnType("text");
+
+                    b.HasKey("Id");
+
+                    b.ToTable("Users");
+                });
+
+            modelBuilder.Entity("FinalAnnotationTagUser", b =>
+                {
+                    b.Property<Guid>("FinalAnnotationTagsId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("UsersId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("FinalAnnotationTagsId", "UsersId");
+
+                    b.HasIndex("UsersId");
+
+                    b.ToTable("FinalAnnotationTagUser");
+                });
+
+            modelBuilder.Entity("Core.Entities.FinalAnnotation", b =>
+                {
+                    b.HasBaseType("Core.Entities.Annotation");
+
+                    b.HasDiscriminator().HasValue("FinalAnnotation");
+                });
+
+            modelBuilder.Entity("AnnotationClass", b =>
+                {
+                    b.HasOne("Core.Entities.Annotation", null)
+                        .WithMany()
+                        .HasForeignKey("AnnotationsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.Class", null)
+                        .WithMany()
+                        .HasForeignKey("ClassesId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                });
+
+            modelBuilder.Entity("AnnotationFinalAnnotation", b =>
+                {
+                    b.HasOne("Core.Entities.Annotation", null)
+                        .WithMany()
+                        .HasForeignKey("AnnotationsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.FinalAnnotation", null)
+                        .WithMany()
+                        .HasForeignKey("FinalAnnotationsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                });
+
+            modelBuilder.Entity("Core.Entities.Annotation", b =>
+                {
+                    b.HasOne("Core.Entities.Document", "Document")
+                        .WithMany()
+                        .HasForeignKey("DocumentId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.User", "UserAssigned")
+                        .WithMany()
+                        .HasForeignKey("UserAssignedId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.User", "User")
+                        .WithMany()
+                        .HasForeignKey("UserId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Document");
+
+                    b.Navigation("User");
+
+                    b.Navigation("UserAssigned");
+                });
+
+            modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
+                {
+                    b.HasOne("Core.Entities.Annotation", "Annotation")
+                        .WithMany()
+                        .HasForeignKey("AnnotationId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.SubTag", "SubTag")
+                        .WithMany()
+                        .HasForeignKey("SubTagId");
+
+                    b.HasOne("Core.Entities.Tag", "Tag")
+                        .WithMany()
+                        .HasForeignKey("TagId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Annotation");
+
+                    b.Navigation("SubTag");
+
+                    b.Navigation("Tag");
+                });
+
+            modelBuilder.Entity("Core.Entities.Document", b =>
+                {
+                    b.HasOne("Core.Entities.DocumentContent", "Content")
+                        .WithMany()
+                        .HasForeignKey("ContentId");
+
+                    b.HasOne("Core.Entities.User", "UserAdded")
+                        .WithMany()
+                        .HasForeignKey("UserAddedId");
+
+                    b.Navigation("Content");
+
+                    b.Navigation("UserAdded");
+                });
+
+            modelBuilder.Entity("Core.Entities.FinalAnnotationTag", b =>
+                {
+                    b.HasOne("Core.Entities.FinalAnnotation", "Annotation")
+                        .WithMany()
+                        .HasForeignKey("AnnotationId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.SubTag", "SubTag")
+                        .WithMany()
+                        .HasForeignKey("SubTagId");
+
+                    b.HasOne("Core.Entities.Tag", "Tag")
+                        .WithMany()
+                        .HasForeignKey("TagId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Annotation");
+
+                    b.Navigation("SubTag");
+
+                    b.Navigation("Tag");
+                });
+
+            modelBuilder.Entity("Core.Entities.SubTag", b =>
+                {
+                    b.HasOne("Core.Entities.Tag", "Tag")
+                        .WithMany()
+                        .HasForeignKey("TagId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Tag");
+                });
+
+            modelBuilder.Entity("Core.Entities.Tag", b =>
+                {
+                    b.HasOne("Core.Entities.TagCategory", "Category")
+                        .WithMany()
+                        .HasForeignKey("CategoryId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Category");
+                });
+
+            modelBuilder.Entity("FinalAnnotationTagUser", b =>
+                {
+                    b.HasOne("Core.Entities.FinalAnnotationTag", null)
+                        .WithMany()
+                        .HasForeignKey("FinalAnnotationTagsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.User", null)
+                        .WithMany()
+                        .HasForeignKey("UsersId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                });
+#pragma warning restore 612, 618
+        }
+    }
+}
diff --git a/Backend/Backend/Migrations/20220517175136_V1.cs b/Backend/Backend/Migrations/20220517175136_V1.cs
new file mode 100644
index 0000000..7829abf
--- /dev/null
+++ b/Backend/Backend/Migrations/20220517175136_V1.cs
@@ -0,0 +1,470 @@
+﻿using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace RestAPI.Migrations
+{
+    public partial class V1 : Migration
+    {
+        protected override void Up(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.CreateTable(
+                name: "Classes",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Name = table.Column<string>(type: "text", nullable: false),
+                    Description = table.Column<string>(type: "text", nullable: false),
+                    Color = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Classes", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "ConfigurationItems",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Value = table.Column<string>(type: "text", nullable: false),
+                    Key = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_ConfigurationItems", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "DocumentContents",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Content = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_DocumentContents", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "TagCategories",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Name = table.Column<string>(type: "text", nullable: true),
+                    Color = table.Column<string>(type: "text", nullable: true),
+                    Description = table.Column<string>(type: "text", nullable: true),
+                    DisabledForAnnotators = table.Column<bool>(type: "boolean", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_TagCategories", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Users",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Username = table.Column<string>(type: "text", nullable: true),
+                    Password = table.Column<string>(type: "text", nullable: true),
+                    Name = table.Column<string>(type: "text", nullable: true),
+                    Surname = table.Column<string>(type: "text", nullable: true),
+                    Role = table.Column<int>(type: "integer", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Users", x => x.Id);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Tags",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    CategoryId = table.Column<Guid>(type: "uuid", nullable: false),
+                    Name = table.Column<string>(type: "text", nullable: false),
+                    Description = table.Column<string>(type: "text", nullable: false),
+                    Color = table.Column<string>(type: "text", nullable: false),
+                    SentimentEnabled = table.Column<bool>(type: "boolean", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Tags", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Tags_TagCategories_CategoryId",
+                        column: x => x.CategoryId,
+                        principalTable: "TagCategories",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Documents",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Name = table.Column<string>(type: "text", nullable: true),
+                    Length = table.Column<int>(type: "integer", nullable: false),
+                    ContentId = table.Column<Guid>(type: "uuid", nullable: true),
+                    DateAdded = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
+                    UserAddedId = table.Column<Guid>(type: "uuid", nullable: true),
+                    RequiredAnnotations = table.Column<int>(type: "integer", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Documents", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Documents_DocumentContents_ContentId",
+                        column: x => x.ContentId,
+                        principalTable: "DocumentContents",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_Documents_Users_UserAddedId",
+                        column: x => x.UserAddedId,
+                        principalTable: "Users",
+                        principalColumn: "Id");
+                });
+
+            migrationBuilder.CreateTable(
+                name: "SubTags",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    Name = table.Column<string>(type: "text", nullable: false),
+                    Description = table.Column<string>(type: "text", nullable: false),
+                    TagId = table.Column<Guid>(type: "uuid", nullable: false),
+                    SentimentEnabled = table.Column<bool>(type: "boolean", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_SubTags", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_SubTags_Tags_TagId",
+                        column: x => x.TagId,
+                        principalTable: "Tags",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "Annotations",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    DocumentId = table.Column<Guid>(type: "uuid", nullable: false),
+                    UserId = table.Column<Guid>(type: "uuid", nullable: false),
+                    UserAssignedId = table.Column<Guid>(type: "uuid", nullable: false),
+                    DateAssigned = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
+                    State = table.Column<int>(type: "integer", nullable: false),
+                    DateLastChanged = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
+                    Note = table.Column<string>(type: "text", nullable: false),
+                    CachedDocumentHTML = table.Column<string>(type: "text", nullable: false),
+                    CachedStartPositions = table.Column<string>(type: "text", nullable: false),
+                    CachedLengths = table.Column<string>(type: "text", nullable: false),
+                    CachedClosingPositions = table.Column<string>(type: "text", nullable: false),
+                    CachedClosingLengths = table.Column<string>(type: "text", nullable: false),
+                    CachedCSS = table.Column<string>(type: "text", nullable: false),
+                    LastModifiedTagId = table.Column<Guid>(type: "uuid", nullable: true),
+                    ModifiedType = table.Column<int>(type: "integer", nullable: false),
+                    Discriminator = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_Annotations", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_Annotations_Documents_DocumentId",
+                        column: x => x.DocumentId,
+                        principalTable: "Documents",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_Annotations_Users_UserAssignedId",
+                        column: x => x.UserAssignedId,
+                        principalTable: "Users",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_Annotations_Users_UserId",
+                        column: x => x.UserId,
+                        principalTable: "Users",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "AnnotationClass",
+                columns: table => new
+                {
+                    AnnotationsId = table.Column<Guid>(type: "uuid", nullable: false),
+                    ClassesId = table.Column<Guid>(type: "uuid", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_AnnotationClass", x => new { x.AnnotationsId, x.ClassesId });
+                    table.ForeignKey(
+                        name: "FK_AnnotationClass_Annotations_AnnotationsId",
+                        column: x => x.AnnotationsId,
+                        principalTable: "Annotations",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_AnnotationClass_Classes_ClassesId",
+                        column: x => x.ClassesId,
+                        principalTable: "Classes",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "AnnotationFinalAnnotation",
+                columns: table => new
+                {
+                    AnnotationsId = table.Column<Guid>(type: "uuid", nullable: false),
+                    FinalAnnotationsId = table.Column<Guid>(type: "uuid", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_AnnotationFinalAnnotation", x => new { x.AnnotationsId, x.FinalAnnotationsId });
+                    table.ForeignKey(
+                        name: "FK_AnnotationFinalAnnotation_Annotations_AnnotationsId",
+                        column: x => x.AnnotationsId,
+                        principalTable: "Annotations",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_AnnotationFinalAnnotation_Annotations_FinalAnnotationsId",
+                        column: x => x.FinalAnnotationsId,
+                        principalTable: "Annotations",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "AnnotationTags",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    AnnotationId = table.Column<Guid>(type: "uuid", nullable: false),
+                    TagId = table.Column<Guid>(type: "uuid", nullable: false),
+                    SubTagId = table.Column<Guid>(type: "uuid", nullable: true),
+                    Instance = table.Column<Guid>(type: "uuid", nullable: false),
+                    Note = table.Column<string>(type: "text", nullable: false),
+                    Position = table.Column<int>(type: "integer", nullable: false),
+                    Length = table.Column<int>(type: "integer", nullable: false),
+                    Sentiment = table.Column<int>(type: "integer", nullable: true),
+                    SelectedText = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_AnnotationTags", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_AnnotationTags_Annotations_AnnotationId",
+                        column: x => x.AnnotationId,
+                        principalTable: "Annotations",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_AnnotationTags_SubTags_SubTagId",
+                        column: x => x.SubTagId,
+                        principalTable: "SubTags",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_AnnotationTags_Tags_TagId",
+                        column: x => x.TagId,
+                        principalTable: "Tags",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "FinalAnnotationTags",
+                columns: table => new
+                {
+                    Id = table.Column<Guid>(type: "uuid", nullable: false),
+                    AnnotationId = table.Column<Guid>(type: "uuid", nullable: false),
+                    IsFinal = table.Column<bool>(type: "boolean", nullable: false),
+                    TagId = table.Column<Guid>(type: "uuid", nullable: false),
+                    SubTagId = table.Column<Guid>(type: "uuid", nullable: true),
+                    Instance = table.Column<Guid>(type: "uuid", nullable: false),
+                    Note = table.Column<string>(type: "text", nullable: false),
+                    Position = table.Column<int>(type: "integer", nullable: false),
+                    Length = table.Column<int>(type: "integer", nullable: false),
+                    Sentiment = table.Column<int>(type: "integer", nullable: true),
+                    SelectedText = table.Column<string>(type: "text", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_FinalAnnotationTags", x => x.Id);
+                    table.ForeignKey(
+                        name: "FK_FinalAnnotationTags_Annotations_AnnotationId",
+                        column: x => x.AnnotationId,
+                        principalTable: "Annotations",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_FinalAnnotationTags_SubTags_SubTagId",
+                        column: x => x.SubTagId,
+                        principalTable: "SubTags",
+                        principalColumn: "Id");
+                    table.ForeignKey(
+                        name: "FK_FinalAnnotationTags_Tags_TagId",
+                        column: x => x.TagId,
+                        principalTable: "Tags",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateTable(
+                name: "FinalAnnotationTagUser",
+                columns: table => new
+                {
+                    FinalAnnotationTagsId = table.Column<Guid>(type: "uuid", nullable: false),
+                    UsersId = table.Column<Guid>(type: "uuid", nullable: false)
+                },
+                constraints: table =>
+                {
+                    table.PrimaryKey("PK_FinalAnnotationTagUser", x => new { x.FinalAnnotationTagsId, x.UsersId });
+                    table.ForeignKey(
+                        name: "FK_FinalAnnotationTagUser_FinalAnnotationTags_FinalAnnotationT~",
+                        column: x => x.FinalAnnotationTagsId,
+                        principalTable: "FinalAnnotationTags",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                    table.ForeignKey(
+                        name: "FK_FinalAnnotationTagUser_Users_UsersId",
+                        column: x => x.UsersId,
+                        principalTable: "Users",
+                        principalColumn: "Id",
+                        onDelete: ReferentialAction.Cascade);
+                });
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AnnotationClass_ClassesId",
+                table: "AnnotationClass",
+                column: "ClassesId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AnnotationFinalAnnotation_FinalAnnotationsId",
+                table: "AnnotationFinalAnnotation",
+                column: "FinalAnnotationsId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Annotations_DocumentId",
+                table: "Annotations",
+                column: "DocumentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Annotations_UserAssignedId",
+                table: "Annotations",
+                column: "UserAssignedId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Annotations_UserId",
+                table: "Annotations",
+                column: "UserId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AnnotationTags_AnnotationId",
+                table: "AnnotationTags",
+                column: "AnnotationId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AnnotationTags_SubTagId",
+                table: "AnnotationTags",
+                column: "SubTagId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_AnnotationTags_TagId",
+                table: "AnnotationTags",
+                column: "TagId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Documents_ContentId",
+                table: "Documents",
+                column: "ContentId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Documents_UserAddedId",
+                table: "Documents",
+                column: "UserAddedId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_FinalAnnotationTags_AnnotationId",
+                table: "FinalAnnotationTags",
+                column: "AnnotationId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_FinalAnnotationTags_SubTagId",
+                table: "FinalAnnotationTags",
+                column: "SubTagId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_FinalAnnotationTags_TagId",
+                table: "FinalAnnotationTags",
+                column: "TagId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_FinalAnnotationTagUser_UsersId",
+                table: "FinalAnnotationTagUser",
+                column: "UsersId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_SubTags_TagId",
+                table: "SubTags",
+                column: "TagId");
+
+            migrationBuilder.CreateIndex(
+                name: "IX_Tags_CategoryId",
+                table: "Tags",
+                column: "CategoryId");
+        }
+
+        protected override void Down(MigrationBuilder migrationBuilder)
+        {
+            migrationBuilder.DropTable(
+                name: "AnnotationClass");
+
+            migrationBuilder.DropTable(
+                name: "AnnotationFinalAnnotation");
+
+            migrationBuilder.DropTable(
+                name: "AnnotationTags");
+
+            migrationBuilder.DropTable(
+                name: "ConfigurationItems");
+
+            migrationBuilder.DropTable(
+                name: "FinalAnnotationTagUser");
+
+            migrationBuilder.DropTable(
+                name: "Classes");
+
+            migrationBuilder.DropTable(
+                name: "FinalAnnotationTags");
+
+            migrationBuilder.DropTable(
+                name: "Annotations");
+
+            migrationBuilder.DropTable(
+                name: "SubTags");
+
+            migrationBuilder.DropTable(
+                name: "Documents");
+
+            migrationBuilder.DropTable(
+                name: "Tags");
+
+            migrationBuilder.DropTable(
+                name: "DocumentContents");
+
+            migrationBuilder.DropTable(
+                name: "Users");
+
+            migrationBuilder.DropTable(
+                name: "TagCategories");
+        }
+    }
+}
diff --git a/Backend/Backend/Migrations/DatabaseContextModelSnapshot.cs b/Backend/Backend/Migrations/DatabaseContextModelSnapshot.cs
index 66256dc..5235a0d 100644
--- a/Backend/Backend/Migrations/DatabaseContextModelSnapshot.cs
+++ b/Backend/Backend/Migrations/DatabaseContextModelSnapshot.cs
@@ -37,21 +37,70 @@ namespace RestAPI.Migrations
                     b.ToTable("AnnotationClass");
                 });
 
+            modelBuilder.Entity("AnnotationFinalAnnotation", b =>
+                {
+                    b.Property<Guid>("AnnotationsId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("FinalAnnotationsId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("AnnotationsId", "FinalAnnotationsId");
+
+                    b.HasIndex("FinalAnnotationsId");
+
+                    b.ToTable("AnnotationFinalAnnotation");
+                });
+
             modelBuilder.Entity("Core.Entities.Annotation", b =>
                 {
                     b.Property<Guid>("Id")
                         .ValueGeneratedOnAdd()
                         .HasColumnType("uuid");
 
+                    b.Property<string>("CachedCSS")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedClosingLengths")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedClosingPositions")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedDocumentHTML")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedLengths")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<string>("CachedStartPositions")
+                        .IsRequired()
+                        .HasColumnType("text");
+
                     b.Property<DateTime>("DateAssigned")
                         .HasColumnType("timestamp with time zone");
 
                     b.Property<DateTime>("DateLastChanged")
                         .HasColumnType("timestamp with time zone");
 
+                    b.Property<string>("Discriminator")
+                        .IsRequired()
+                        .HasColumnType("text");
+
                     b.Property<Guid>("DocumentId")
                         .HasColumnType("uuid");
 
+                    b.Property<Guid?>("LastModifiedTagId")
+                        .HasColumnType("uuid");
+
+                    b.Property<int>("ModifiedType")
+                        .HasColumnType("integer");
+
                     b.Property<string>("Note")
                         .IsRequired()
                         .HasColumnType("text");
@@ -74,6 +123,8 @@ namespace RestAPI.Migrations
                     b.HasIndex("UserId");
 
                     b.ToTable("Annotations");
+
+                    b.HasDiscriminator<string>("Discriminator").HasValue("Annotation");
                 });
 
             modelBuilder.Entity("Core.Entities.AnnotationTag", b =>
@@ -98,6 +149,13 @@ namespace RestAPI.Migrations
                     b.Property<int>("Position")
                         .HasColumnType("integer");
 
+                    b.Property<string>("SelectedText")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("Sentiment")
+                        .HasColumnType("integer");
+
                     b.Property<Guid?>("SubTagId")
                         .HasColumnType("uuid");
 
@@ -205,6 +263,55 @@ namespace RestAPI.Migrations
                     b.ToTable("DocumentContents");
                 });
 
+            modelBuilder.Entity("Core.Entities.FinalAnnotationTag", b =>
+                {
+                    b.Property<Guid>("Id")
+                        .ValueGeneratedOnAdd()
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("AnnotationId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("Instance")
+                        .HasColumnType("uuid");
+
+                    b.Property<bool>("IsFinal")
+                        .HasColumnType("boolean");
+
+                    b.Property<int>("Length")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("Note")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int>("Position")
+                        .HasColumnType("integer");
+
+                    b.Property<string>("SelectedText")
+                        .IsRequired()
+                        .HasColumnType("text");
+
+                    b.Property<int?>("Sentiment")
+                        .HasColumnType("integer");
+
+                    b.Property<Guid?>("SubTagId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("TagId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("Id");
+
+                    b.HasIndex("AnnotationId");
+
+                    b.HasIndex("SubTagId");
+
+                    b.HasIndex("TagId");
+
+                    b.ToTable("FinalAnnotationTags");
+                });
+
             modelBuilder.Entity("Core.Entities.SubTag", b =>
                 {
                     b.Property<Guid>("Id")
@@ -219,6 +326,9 @@ namespace RestAPI.Migrations
                         .IsRequired()
                         .HasColumnType("text");
 
+                    b.Property<bool>("SentimentEnabled")
+                        .HasColumnType("boolean");
+
                     b.Property<Guid>("TagId")
                         .HasColumnType("uuid");
 
@@ -250,6 +360,9 @@ namespace RestAPI.Migrations
                         .IsRequired()
                         .HasColumnType("text");
 
+                    b.Property<bool>("SentimentEnabled")
+                        .HasColumnType("boolean");
+
                     b.HasKey("Id");
 
                     b.HasIndex("CategoryId");
@@ -269,6 +382,9 @@ namespace RestAPI.Migrations
                     b.Property<string>("Description")
                         .HasColumnType("text");
 
+                    b.Property<bool>("DisabledForAnnotators")
+                        .HasColumnType("boolean");
+
                     b.Property<string>("Name")
                         .HasColumnType("text");
 
@@ -303,6 +419,28 @@ namespace RestAPI.Migrations
                     b.ToTable("Users");
                 });
 
+            modelBuilder.Entity("FinalAnnotationTagUser", b =>
+                {
+                    b.Property<Guid>("FinalAnnotationTagsId")
+                        .HasColumnType("uuid");
+
+                    b.Property<Guid>("UsersId")
+                        .HasColumnType("uuid");
+
+                    b.HasKey("FinalAnnotationTagsId", "UsersId");
+
+                    b.HasIndex("UsersId");
+
+                    b.ToTable("FinalAnnotationTagUser");
+                });
+
+            modelBuilder.Entity("Core.Entities.FinalAnnotation", b =>
+                {
+                    b.HasBaseType("Core.Entities.Annotation");
+
+                    b.HasDiscriminator().HasValue("FinalAnnotation");
+                });
+
             modelBuilder.Entity("AnnotationClass", b =>
                 {
                     b.HasOne("Core.Entities.Annotation", null)
@@ -318,6 +456,21 @@ namespace RestAPI.Migrations
                         .IsRequired();
                 });
 
+            modelBuilder.Entity("AnnotationFinalAnnotation", b =>
+                {
+                    b.HasOne("Core.Entities.Annotation", null)
+                        .WithMany()
+                        .HasForeignKey("AnnotationsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.FinalAnnotation", null)
+                        .WithMany()
+                        .HasForeignKey("FinalAnnotationsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                });
+
             modelBuilder.Entity("Core.Entities.Annotation", b =>
                 {
                     b.HasOne("Core.Entities.Document", "Document")
@@ -385,6 +538,31 @@ namespace RestAPI.Migrations
                     b.Navigation("UserAdded");
                 });
 
+            modelBuilder.Entity("Core.Entities.FinalAnnotationTag", b =>
+                {
+                    b.HasOne("Core.Entities.FinalAnnotation", "Annotation")
+                        .WithMany()
+                        .HasForeignKey("AnnotationId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.SubTag", "SubTag")
+                        .WithMany()
+                        .HasForeignKey("SubTagId");
+
+                    b.HasOne("Core.Entities.Tag", "Tag")
+                        .WithMany()
+                        .HasForeignKey("TagId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.Navigation("Annotation");
+
+                    b.Navigation("SubTag");
+
+                    b.Navigation("Tag");
+                });
+
             modelBuilder.Entity("Core.Entities.SubTag", b =>
                 {
                     b.HasOne("Core.Entities.Tag", "Tag")
@@ -406,6 +584,21 @@ namespace RestAPI.Migrations
 
                     b.Navigation("Category");
                 });
+
+            modelBuilder.Entity("FinalAnnotationTagUser", b =>
+                {
+                    b.HasOne("Core.Entities.FinalAnnotationTag", null)
+                        .WithMany()
+                        .HasForeignKey("FinalAnnotationTagsId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+
+                    b.HasOne("Core.Entities.User", null)
+                        .WithMany()
+                        .HasForeignKey("UsersId")
+                        .OnDelete(DeleteBehavior.Cascade)
+                        .IsRequired();
+                });
 #pragma warning restore 612, 618
         }
     }
diff --git a/Backend/Backend/Program.cs b/Backend/Backend/Program.cs
index 7772387..8621d7f 100644
--- a/Backend/Backend/Program.cs
+++ b/Backend/Backend/Program.cs
@@ -115,12 +115,13 @@ using (var scope = app.Services.CreateScope())
     {
         //context.Database.EnsureDeleted();
         //context.Database.EnsureCreated();
-        //context.Database.Migrate();
+        context.Database.Migrate();
         Seeder.SeedDevelopment(context);
     }
     else
     {
         // In production we seed administrator 
+        context.Database.Migrate();
         Seeder.SeedProduction(context);
     }
 }
