diff --git a/migrations/add_auto_add_root_dse_column.sql b/migrations/add_auto_add_root_dse_column.sql new file mode 100644 index 0000000..d1e78dc --- /dev/null +++ b/migrations/add_auto_add_root_dse_column.sql @@ -0,0 +1,9 @@ +-- Add autoAddRootDSE column to dynamic_group_rules table +ALTER TABLE dynamic_group_rules ADD COLUMN IF NOT EXISTS auto_add_root_dse BOOLEAN DEFAULT TRUE; + +-- Update existing records to set autoAddRootDSE to TRUE for better user experience +UPDATE dynamic_group_rules SET auto_add_root_dse = TRUE WHERE auto_add_root_dse IS NULL; + +-- Change the defaults for create_group_if_not_exists and create_ou_if_not_exists to TRUE +ALTER TABLE dynamic_group_rules ALTER COLUMN create_group_if_not_exists SET DEFAULT TRUE; +ALTER TABLE dynamic_group_rules ALTER COLUMN create_ou_if_not_exists SET DEFAULT TRUE; \ No newline at end of file diff --git a/shared/schema.ts b/shared/schema.ts index 7d39e93..0b92fea 100644 --- a/shared/schema.ts +++ b/shared/schema.ts @@ -201,10 +201,11 @@ export const dynamicGroupRules = pgTable("dynamic_group_rules", { lastRunStatus: text("last_run_status"), variablePattern: text("variable_pattern"), // Pattern for dynamic group name, e.g. "{{department}}-Users" useAdvancedScheduling: boolean("use_advanced_scheduling").default(false), - createGroupIfNotExists: boolean("create_group_if_not_exists").default(false), - createOUIfNotExists: boolean("create_ou_if_not_exists").default(false), + createGroupIfNotExists: boolean("create_group_if_not_exists").default(true), // Changed default to true + createOUIfNotExists: boolean("create_ou_if_not_exists").default(true), // Changed default to true createGroupForEachAttributeValue: boolean("create_group_for_each_attribute_value").default(false), createOUForEachAttributeValue: boolean("create_ou_for_each_attribute_value").default(false), + autoAddRootDSE: boolean("auto_add_root_dse").default(true), // Added with default true }); // Rule conditions (filter logic)