@@ -2493,6 +2493,32 @@ func (p *Parser) parseCreateTableStatement() (*ast.CreateTableStatement, error)
24932493 p .nextToken ()
24942494 }
24952495
2496+ // Parse optional ON filegroup and TEXTIMAGE_ON filegroup clauses
2497+ for {
2498+ upperLit := strings .ToUpper (p .curTok .Literal )
2499+ if p .curTok .Type == TokenOn {
2500+ p .nextToken () // consume ON
2501+ // Parse filegroup identifier
2502+ ident := p .parseIdentifier ()
2503+ stmt .OnFileGroupOrPartitionScheme = & ast.FileGroupOrPartitionScheme {
2504+ Name : & ast.IdentifierOrValueExpression {
2505+ Value : ident .Value ,
2506+ Identifier : ident ,
2507+ },
2508+ }
2509+ } else if upperLit == "TEXTIMAGE_ON" {
2510+ p .nextToken () // consume TEXTIMAGE_ON
2511+ // Parse filegroup identifier
2512+ ident := p .parseIdentifier ()
2513+ stmt .TextImageOn = & ast.IdentifierOrValueExpression {
2514+ Value : ident .Value ,
2515+ Identifier : ident ,
2516+ }
2517+ } else {
2518+ break
2519+ }
2520+ }
2521+
24962522 // Skip optional semicolon
24972523 if p .curTok .Type == TokenSemicolon {
24982524 p .nextToken ()
@@ -2556,6 +2582,10 @@ func (p *Parser) parseColumnDefinition() (*ast.ColumnDefinition, error) {
25562582 p .nextToken () // consume REPLICATION
25572583 identityOpts .NotForReplication = true
25582584 }
2585+ } else if p .curTok .Type == TokenNull {
2586+ // NOT NULL after IDENTITY - handle it here since NOT was already consumed
2587+ p .nextToken () // consume NULL
2588+ col .Constraints = append (col .Constraints , & ast.NullableConstraintDefinition {Nullable : false })
25592589 }
25602590 }
25612591
@@ -2875,6 +2905,12 @@ func createTableStatementToJSON(s *ast.CreateTableStatement) jsonNode {
28752905 if s .Definition != nil {
28762906 node ["Definition" ] = tableDefinitionToJSON (s .Definition )
28772907 }
2908+ if s .OnFileGroupOrPartitionScheme != nil {
2909+ node ["OnFileGroupOrPartitionScheme" ] = fileGroupOrPartitionSchemeToJSON (s .OnFileGroupOrPartitionScheme )
2910+ }
2911+ if s .TextImageOn != nil {
2912+ node ["TextImageOn" ] = identifierOrValueExpressionToJSON (s .TextImageOn )
2913+ }
28782914 return node
28792915}
28802916
0 commit comments