text: USE [master]
  GO
  /****** Object:  Database [TaskManager]    Script Date: 08/03/2020 23:59:51 ******/
  CREATE DATABASE [TaskManager]
   CONTAINMENT = NONE
   ON  PRIMARY 
  ( NAME = N'TaskManager', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\TaskManager.mdf' , SIZE = 5120KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
   LOG ON 
  ( NAME = N'TaskManager_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\TaskManager_log.ldf' , SIZE = 3072KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
  GO
  ALTER DATABASE [TaskManager] SET COMPATIBILITY_LEVEL = 140
  GO
  IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
  begin
  EXEC [TaskManager].[dbo].[sp_fulltext_database] @action = 'enable'
  end
  GO
  ALTER DATABASE [TaskManager] SET ANSI_NULL_DEFAULT OFF 
  GO
  ALTER DATABASE [TaskManager] SET ANSI_NULLS OFF 
  GO
  ALTER DATABASE [TaskManager] SET ANSI_PADDING OFF 
  GO
  ALTER DATABASE [TaskManager] SET ANSI_WARNINGS OFF 
  GO
  ALTER DATABASE [TaskManager] SET ARITHABORT OFF 
  GO
  ALTER DATABASE [TaskManager] SET AUTO_CLOSE OFF 
  GO
  ALTER DATABASE [TaskManager] SET AUTO_SHRINK OFF 
  GO
  ALTER DATABASE [TaskManager] SET AUTO_UPDATE_STATISTICS ON 
  GO
  ALTER DATABASE [TaskManager] SET CURSOR_CLOSE_ON_COMMIT OFF 
  GO
  ALTER DATABASE [TaskManager] SET CURSOR_DEFAULT  GLOBAL 
  GO
  ALTER DATABASE [TaskManager] SET CONCAT_NULL_YIELDS_NULL OFF 
  GO
  ALTER DATABASE [TaskManager] SET NUMERIC_ROUNDABORT OFF 
  GO
  ALTER DATABASE [TaskManager] SET QUOTED_IDENTIFIER OFF 
  GO
  ALTER DATABASE [TaskManager] SET RECURSIVE_TRIGGERS OFF 
  GO
  ALTER DATABASE [TaskManager] SET  DISABLE_BROKER 
  GO
  ALTER DATABASE [TaskManager] SET AUTO_UPDATE_STATISTICS_ASYNC OFF 
  GO
  ALTER DATABASE [TaskManager] SET DATE_CORRELATION_OPTIMIZATION OFF 
  GO
  ALTER DATABASE [TaskManager] SET TRUSTWORTHY OFF 
  GO
  ALTER DATABASE [TaskManager] SET ALLOW_SNAPSHOT_ISOLATION OFF 
  GO
  ALTER DATABASE [TaskManager] SET PARAMETERIZATION SIMPLE 
  GO
  ALTER DATABASE [TaskManager] SET READ_COMMITTED_SNAPSHOT OFF 
  GO
  ALTER DATABASE [TaskManager] SET HONOR_BROKER_PRIORITY OFF 
  GO
  ALTER DATABASE [TaskManager] SET RECOVERY SIMPLE 
  GO
  ALTER DATABASE [TaskManager] SET  MULTI_USER 
  GO
  ALTER DATABASE [TaskManager] SET PAGE_VERIFY CHECKSUM  
  GO
  ALTER DATABASE [TaskManager] SET DB_CHAINING OFF 
  GO
  ALTER DATABASE [TaskManager] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF ) 
  GO
  ALTER DATABASE [TaskManager] SET TARGET_RECOVERY_TIME = 0 SECONDS 
  GO
  ALTER DATABASE [TaskManager] SET DELAYED_DURABILITY = DISABLED 
  GO
  ALTER DATABASE [TaskManager] SET QUERY_STORE = OFF
  GO
  USE [TaskManager]
  GO
  ALTER DATABASE SCOPED CONFIGURATION SET IDENTITY_CACHE = ON;
  GO
  ALTER DATABASE SCOPED CONFIGURATION SET LEGACY_CARDINALITY_ESTIMATION = OFF;
  GO
  ALTER DATABASE SCOPED CONFIGURATION FOR SECONDARY SET LEGACY_CARDINALITY_ESTIMATION = PRIMARY;
  GO
  ALTER DATABASE SCOPED CONFIGURATION SET MAXDOP = 0;
  GO
  ALTER DATABASE SCOPED CONFIGURATION FOR SECONDARY SET MAXDOP = PRIMARY;
  GO
  ALTER DATABASE SCOPED CONFIGURATION SET PARAMETER_SNIFFING = ON;
  GO
  ALTER DATABASE SCOPED CONFIGURATION FOR SECONDARY SET PARAMETER_SNIFFING = PRIMARY;
  GO
  ALTER DATABASE SCOPED CONFIGURATION SET QUERY_OPTIMIZER_HOTFIXES = OFF;
  GO
  ALTER DATABASE SCOPED CONFIGURATION FOR SECONDARY SET QUERY_OPTIMIZER_HOTFIXES = PRIMARY;
  GO
  USE [TaskManager]
  GO
  /****** Object:  Table [dbo].[Task]    Script Date: 08/03/2020 23:59:52 ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[Task](
  	[Id] [bigint] IDENTITY(1,1) NOT NULL,
  	[Description] [nvarchar](900) NOT NULL,
  	[Concluded] [bit] NOT NULL,
  	[User_Id] [bigint] NOT NULL,
   CONSTRAINT [PK_Task] PRIMARY KEY CLUSTERED 
  (
  	[Id] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  GO
  /****** Object:  Table [dbo].[User]    Script Date: 08/03/2020 23:59:52 ******/
  SET ANSI_NULLS ON
  GO
  SET QUOTED_IDENTIFIER ON
  GO
  CREATE TABLE [dbo].[User](
  	[Id] [bigint] IDENTITY(1,1) NOT NULL,
  	[Firstname] [nvarchar](128) NOT NULL,
  	[Lastname] [nvarchar](128) NOT NULL,
  	[Email] [nvarchar](128) NOT NULL,
  	[Passworh_Hash] [nvarchar](512) NOT NULL,
  	[Password_Salt] [nvarchar](512) NOT NULL,
  	[Registration_Date] [datetime2](7) NOT NULL,
  	[Last_Update_Date] [datetime2](7) NULL,
   CONSTRAINT [PK_User] PRIMARY KEY CLUSTERED 
  (
  	[Id] ASC
  )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
  ) ON [PRIMARY]
  GO
  ALTER TABLE [dbo].[Task] ADD  CONSTRAINT [DF_Task_Concluded]  DEFAULT ((0)) FOR [Concluded]
  GO
  ALTER TABLE [dbo].[User] ADD  CONSTRAINT [DF_User_RegistrationDate]  DEFAULT (getdate()) FOR [Registration_Date]
  GO
  ALTER TABLE [dbo].[Task]  WITH CHECK ADD  CONSTRAINT [FK_User_Task] FOREIGN KEY([User_Id])
  REFERENCES [dbo].[User] ([Id])
  ON UPDATE CASCADE
  ON DELETE CASCADE
  GO
  ALTER TABLE [dbo].[Task] CHECK CONSTRAINT [FK_User_Task]
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Identificação da Task' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Task', @level2type=N'COLUMN',@level2name=N'Id'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Descrição da Task' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Task', @level2type=N'COLUMN',@level2name=N'Description'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Flag de Estado da Task' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Task', @level2type=N'COLUMN',@level2name=N'Concluded'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id do Usuário' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Task', @level2type=N'COLUMN',@level2name=N'User_Id'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Tabela que armazena as Tasks dos Usuários' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Task'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Relacionamento entre tabelas Task e User' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Task', @level2type=N'CONSTRAINT',@level2name=N'FK_User_Task'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Nome do usuário' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Firstname'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Sobrenome do usuário' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Lastname'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Email' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Email'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Hash de senha' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Passworh_Hash'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Entropia para calcular Hash' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Password_Salt'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Data do Registro do usuário' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Registration_Date'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Data da Última atualização' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User', @level2type=N'COLUMN',@level2name=N'Last_Update_Date'
  GO
  EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Tabela que armazena dados dos usuários' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'User'
  GO
  USE [master]
  GO
  ALTER DATABASE [TaskManager] SET  READ_WRITE 
  GO
  