00:00:00.000
S - start or stop, ESC - reset
/* Do not change the database path or name variables. Any sqlcmd variables will be properly substituted during build and deployment. */ ALTER DATABASE [$(DatabaseName)] ADD FILEGROUP [DATA]
/* Do not change the database path or name variables. Any sqlcmd variables will be properly substituted during build and deployment. */ ALTER DATABASE [$(DatabaseName)] ADD FILEGROUP [INDEXES]
CREATE PROCEDURE [Application].CreateRoleIfNonexistent @RoleName sysname WITH EXECUTE AS OWNER AS BEGIN SET NOCOUNT ON; SET XACT_ABORT ON; IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = @RoleName AND type = N'R') BEGIN BEGIN TRY DECLARE @SQL nvarchar(max) = N'CREATE ROLE ' + QUOTENAME(@RoleName) + N';' EXECUTE (@SQL); PRINT N'Role ' + @RoleName + N' created'; END TRY BEGIN CATCH PRINT N'Unable to create role ' + @RoleName; THROW; END CATCH; END; END;
CREATE SCHEMA [Application] AUTHORIZATION [dbo]; GO EXECUTE sp_addextendedproperty @name = N'Description', @value = N'Tables common across the application. Used for categorization and lookup lists, system parameters and people (users and contacts)', @level0type = N'SCHEMA', @level0name = N'Application';
CREATE TABLE [Application].[People] ( [PersonID] INT NOT NULL, [FullName] NVARCHAR (50) NOT NULL, CONSTRAINT [PK_Application_People] PRIMARY KEY CLUSTERED ([PersonID] ASC) ) GO EXECUTE sp_addextendedproperty @name = N'Description', @value = 'Full name for this person', @level0type = N'SCHEMA', @level0name = N'Application', @level1type = N'TABLE', @level1name = N'People', @level2type = N'COLUMN', @level2name = N'FullName'; GO EXECUTE sp_addextendedproperty @name = N'Description', @value = 'Numeric ID used for reference to a person within the database', @level0type = N'SCHEMA', @level0name = N'Application', @level1type = N'TABLE', @level1name = N'People', @level2type = N'COLUMN', @level2name = N'PersonID'; GO EXECUTE sp_addextendedproperty @name = N'Description', @value = N'People known to the application (staff, customer contacts, supplier contacts)', @level0type = N'SCHEMA', @level0name = N'Application', @level1type = N'TABLE', @level1name = N'People';
CREATE TABLE People ( PersonID INT NOT NULL PRIMARY KEY CLUSTERED, LastName VARCHAR(255) NOT NULL, FirstName VARCHAR(255) NOT NULL, Address VARCHAR(255) NULL, City VARCHAR(255) NULL );
CREATE TABLE People ( PersonID INT NOT NULL PRIMARY KEY CLUSTERED, LastName VARCHAR(255) NOT NULL, FirstName VARCHAR(255) NOT NULL, Address VARCHAR(255) NULL, City VARCHAR(255) NULL, Country VARCHAR(255) NULL );
extension_dir = "ext" extension=php_openssl.dll
(function () { 'use strict'; angular .module('app', []) .config(config); config.$inject = ['$provide']; function config($provide) { $provide.decorator('$exceptionHandler', myExceptionHandler); } myExceptionHandler.$inject = ['$delegate', '$window']; function myExceptionHandler($delegate, $window) { return function (exception, cause) { // Keep default implementation. $delegate(exception, cause); // Execute server side logging. // Need to wrap to try catch, to prevent infinitive loop. try { // Cannot use $http service because of circular references. $.ajax({ type: 'POST', url: '/api/log/', contentType: 'application/json', data: angular.toJson({ url: $window.location.href, message: exception.message, stack: exception.stack, }) }); } catch (e) { // Do nothing, browser will display message in console. } }; } })();
myExceptionHandler.$inject = ['$delegate', '$window', '$http']; function myExceptionHandler($delegate, $window, $http) { // Code inside }
(function () { 'use strict'; angular .module('app', []) .config(config); config.$inject = ['$provide']; function config($provide) { $provide.decorator('$exceptionHandler', myExceptionHandler); } myExceptionHandler.$inject = ['$delegate', '$window', '$injector']; function myExceptionHandler($delegate, $window, $injector) { return function (exception, cause) { // Keep default implementation. $delegate(exception, cause); // Execute server side logging. // Need to wrap to try catch, to prevent infinitive loop. try { // Using $injector to get $http service. var http = $injector.get('$http'); http.post('/api/log/', { url: $window.location.href, message: exception.message, stack: exception.stack, }); } catch (e) { // Do nothing, browser will display message in console. } }; } })();