コード例 #1
0
        public void Create()
        {
            var schemaQueryBuilder = new SchemaQueryBuilder <TestComposed>(new Mapper(), driverMock.Object);

            schemaQueryBuilder.CreateTable();
            Assert.Equal("CREATE TABLE \"TestComposed\" ( \"Id\" TEST PRIMARY KEY AUTO_INCREMENT,\"Text\" TEST,\"Composed_Text\" TEST,\"Composed_Number\" TEST)", schemaQueryBuilder.Sql);
        }
コード例 #2
0
        public void Update()
        {
            var schemaQueryBuilder  = new SchemaQueryBuilder <TestComposed>(new Mapper(), driverMock.Object);
            var existingDefinitions = new List <IColumnDefinition>();

            schemaQueryBuilder.AlterTable().AlterColumns(existingDefinitions);
            Assert.Equal("ALTER TABLE \"TestComposed\" ADD COLUMN \"Id\" TEST PRIMARY KEY AUTO_INCREMENT; ALTER TABLE \"TestComposed\" ADD COLUMN \"Text\" TEST; ALTER TABLE \"Composed\" ADD COLUMN \"Composed_Text\" TEST; ALTER TABLE \"Composed\" ADD COLUMN \"Composed_Number\" TEST", schemaQueryBuilder.Sql);
        }