@@ -24,7 +24,6 @@ import { Schema } from "./types";
2424import { Options } from "../options" ;
2525import { FirebaseError } from "../error" ;
2626import { logLabeledBullet , logLabeledWarning , logLabeledSuccess } from "../utils" ;
27- import * as experiments from "../experiments" ;
2827import * as errors from "./errors" ;
2928
3029export async function diffSchema (
@@ -41,13 +40,11 @@ export async function diffSchema(
4140 let diffs : Diff [ ] = [ ] ;
4241
4342 // If the schema validation mode is unset, we surface both STRICT and COMPATIBLE mode diffs, starting with COMPATIBLE.
44- let validationMode : SchemaValidation = experiments . isEnabled ( "fdccompatiblemode" )
45- ? schemaValidation ?? "COMPATIBLE"
46- : "STRICT" ;
43+ let validationMode : SchemaValidation = schemaValidation ?? "COMPATIBLE" ;
4744 setSchemaValidationMode ( schema , validationMode ) ;
4845
4946 try {
50- if ( ! schemaValidation && experiments . isEnabled ( "fdccompatiblemode" ) ) {
47+ if ( ! schemaValidation ) {
5148 logLabeledBullet ( "dataconnect" , `generating required schema changes...` ) ;
5249 }
5350 await upsertSchema ( schema , /** validateOnly=*/ true ) ;
@@ -78,7 +75,7 @@ export async function diffSchema(
7875 }
7976
8077 // If the validation mode is unset, then we also surface any additional optional STRICT diffs.
81- if ( experiments . isEnabled ( "fdccompatiblemode" ) && ! schemaValidation ) {
78+ if ( ! schemaValidation ) {
8279 validationMode = "STRICT" ;
8380 setSchemaValidationMode ( schema , validationMode ) ;
8481 try {
@@ -127,9 +124,7 @@ export async function migrateSchema(args: {
127124 let diffs : Diff [ ] = [ ] ;
128125
129126 // If the schema validation mode is unset, we surface both STRICT and COMPATIBLE mode diffs, starting with COMPATIBLE.
130- let validationMode : SchemaValidation = experiments . isEnabled ( "fdccompatiblemode" )
131- ? schemaValidation ?? "COMPATIBLE"
132- : "STRICT" ;
127+ let validationMode : SchemaValidation = schemaValidation ?? "COMPATIBLE" ;
133128 setSchemaValidationMode ( schema , validationMode ) ;
134129
135130 try {
@@ -183,7 +178,7 @@ export async function migrateSchema(args: {
183178 }
184179
185180 // If the validation mode is unset, then we also surface any additional optional STRICT diffs.
186- if ( experiments . isEnabled ( "fdccompatiblemode" ) && ! schemaValidation ) {
181+ if ( ! schemaValidation ) {
187182 validationMode = "STRICT" ;
188183 setSchemaValidationMode ( schema , validationMode ) ;
189184 try {
@@ -274,11 +269,9 @@ function diffsEqual(x: Diff[], y: Diff[]): boolean {
274269}
275270
276271function setSchemaValidationMode ( schema : Schema , schemaValidation : SchemaValidation ) {
277- if ( experiments . isEnabled ( "fdccompatiblemode" ) ) {
278- const postgresDatasource = schema . datasources . find ( ( d ) => d . postgresql ) ;
279- if ( postgresDatasource ?. postgresql ) {
280- postgresDatasource . postgresql . schemaValidation = schemaValidation ;
281- }
272+ const postgresDatasource = schema . datasources . find ( ( d ) => d . postgresql ) ;
273+ if ( postgresDatasource ?. postgresql ) {
274+ postgresDatasource . postgresql . schemaValidation = schemaValidation ;
282275 }
283276}
284277
0 commit comments