Ejemplo n.º 1
0
        public void Create(VersionModel versionModel)
        {
            var subDirectory = versionModel.Database + "\\" + versionModel.Name;
            if (Directory.Exists(subDirectory))
            {
                throw new ApplicationException("That version (directory) already exists.");
            }

            Directory.CreateDirectory(subDirectory);
            File.CreateText(subDirectory + "\\Up.sql");
            File.CreateText(subDirectory + "\\Down.sql");
        }
Ejemplo n.º 2
0
        public void Run(ICommandContext context)
        {
            _context = context;

            parseParameters();

            var versionModel = new VersionModel
            {
                Database = _setupParameters.Directory,
                Name = _versionName
            };

            _versionRepository.Create(versionModel);
        }