diff --git a/prisma-fmt/tests/text_document_completion/scenarios/extended_indexes_basic/schema.prisma b/prisma-fmt/tests/text_document_completion/scenarios/extended_indexes_basic/schema.prisma index d46c84b78d3b..c434cb5c4d86 100644 --- a/prisma-fmt/tests/text_document_completion/scenarios/extended_indexes_basic/schema.prisma +++ b/prisma-fmt/tests/text_document_completion/scenarios/extended_indexes_basic/schema.prisma @@ -1,6 +1,5 @@ generator js { provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] } datasource db { diff --git a/psl/psl-core/src/common/preview_features.rs b/psl/psl-core/src/common/preview_features.rs index ea9b0eceea81..36a64ad2af0e 100644 --- a/psl/psl-core/src/common/preview_features.rs +++ b/psl/psl-core/src/common/preview_features.rs @@ -90,7 +90,6 @@ pub const ALL_PREVIEW_FEATURES: FeatureMap = FeatureMap { active: enumflags2::make_bitflags!(PreviewFeature::{ Deno | DriverAdapters - | FullTextIndex | FullTextSearch | Metrics | MultiSchema @@ -117,6 +116,7 @@ pub const ALL_PREVIEW_FEATURES: FeatureMap = FeatureMap { | FieldReference | FilteredRelationCount | FilterJson + | FullTextIndex | GroupBy | ImprovedQueryRaw | InteractiveTransactions diff --git a/psl/psl-core/src/validate/validation_pipeline/validations.rs b/psl/psl-core/src/validate/validation_pipeline/validations.rs index 76e277be7394..a36bdebbb52b 100644 --- a/psl/psl-core/src/validate/validation_pipeline/validations.rs +++ b/psl/psl-core/src/validate/validation_pipeline/validations.rs @@ -116,7 +116,6 @@ pub(super) fn validate(ctx: &mut Context<'_>) { indexes::field_length_prefix_supported(index, ctx); indexes::index_algorithm_is_supported(index, ctx); indexes::hash_index_must_not_use_sort_param(index, ctx); - indexes::fulltext_index_preview_feature_enabled(index, ctx); indexes::fulltext_index_supported(index, ctx); indexes::fulltext_columns_should_not_define_length(index, ctx); indexes::fulltext_column_sort_is_supported(index, ctx); diff --git a/psl/psl-core/src/validate/validation_pipeline/validations/indexes.rs b/psl/psl-core/src/validate/validation_pipeline/validations/indexes.rs index e9bae626f374..0819fe9cb059 100644 --- a/psl/psl-core/src/validate/validation_pipeline/validations/indexes.rs +++ b/psl/psl-core/src/validate/validation_pipeline/validations/indexes.rs @@ -3,7 +3,6 @@ use crate::{ datamodel_connector::{walker_ext_traits::*, ConnectorCapability}, diagnostics::DatamodelError, validate::validation_pipeline::context::Context, - PreviewFeature, }; use itertools::Itertools; use parser_database::{walkers::IndexWalker, IndexAlgorithm}; @@ -87,23 +86,6 @@ pub(crate) fn field_length_prefix_supported(index: IndexWalker<'_>, ctx: &mut Co } } -/// `@@fulltext` attribute is not available without `fullTextIndex` preview feature. -pub(crate) fn fulltext_index_preview_feature_enabled(index: IndexWalker<'_>, ctx: &mut Context<'_>) { - if ctx.preview_features.contains(PreviewFeature::FullTextIndex) { - return; - } - - if index.is_fulltext() { - let message = "You must enable `fullTextIndex` preview feature to be able to define a @@fulltext index."; - - ctx.push_error(DatamodelError::new_attribute_validation_error( - message, - index.attribute_name(), - index.ast_attribute().span, - )); - } -} - /// `@@fulltext` should only be available if we support it in the database. pub(crate) fn fulltext_index_supported(index: IndexWalker<'_>, ctx: &mut Context<'_>) { if ctx.has_capability(ConnectorCapability::FullTextIndex) { @@ -123,10 +105,6 @@ pub(crate) fn fulltext_index_supported(index: IndexWalker<'_>, ctx: &mut Context /// `@@fulltext` index columns should not define `length` argument. pub(crate) fn fulltext_columns_should_not_define_length(index: IndexWalker<'_>, ctx: &mut Context<'_>) { - if !ctx.preview_features.contains(PreviewFeature::FullTextIndex) { - return; - } - if !ctx.has_capability(ConnectorCapability::FullTextIndex) { return; } @@ -148,10 +126,6 @@ pub(crate) fn fulltext_columns_should_not_define_length(index: IndexWalker<'_>, /// Only MongoDB supports sort order in a fulltext index. pub(crate) fn fulltext_column_sort_is_supported(index: IndexWalker<'_>, ctx: &mut Context<'_>) { - if !ctx.preview_features.contains(PreviewFeature::FullTextIndex) { - return; - } - if !ctx.has_capability(ConnectorCapability::FullTextIndex) { return; } @@ -181,10 +155,6 @@ pub(crate) fn fulltext_column_sort_is_supported(index: IndexWalker<'_>, ctx: &mu /// @@fulltext([a(sort: Asc), b, c(sort: Asc), d]) /// ``` pub(crate) fn fulltext_text_columns_should_be_bundled_together(index: IndexWalker<'_>, ctx: &mut Context<'_>) { - if !ctx.preview_features.contains(PreviewFeature::FullTextIndex) { - return; - } - if !ctx.has_capability(ConnectorCapability::FullTextIndex) { return; } diff --git a/psl/psl-core/src/validate/validation_pipeline/validations/models.rs b/psl/psl-core/src/validate/validation_pipeline/validations/models.rs index a53063624b2d..2cb04a461503 100644 --- a/psl/psl-core/src/validate/validation_pipeline/validations/models.rs +++ b/psl/psl-core/src/validate/validation_pipeline/validations/models.rs @@ -4,7 +4,6 @@ use crate::{ diagnostics::DatamodelError, parser_database::ast::{WithName, WithSpan}, validate::validation_pipeline::context::Context, - PreviewFeature, }; use parser_database::walkers::{ModelWalker, PrimaryKeyWalker}; use std::{borrow::Cow, collections::HashMap}; @@ -175,10 +174,6 @@ pub(crate) fn primary_key_sort_order_supported(model: ModelWalker<'_>, ctx: &mut } pub(crate) fn only_one_fulltext_attribute_allowed(model: ModelWalker<'_>, ctx: &mut Context<'_>) { - if !ctx.preview_features.contains(PreviewFeature::FullTextIndex) { - return; - } - if !ctx.has_capability(ConnectorCapability::FullTextIndex) { return; } diff --git a/psl/psl/tests/attributes/composite_index.rs b/psl/psl/tests/attributes/composite_index.rs index a98887b26eec..4190ce2609a4 100644 --- a/psl/psl/tests/attributes/composite_index.rs +++ b/psl/psl/tests/attributes/composite_index.rs @@ -81,7 +81,7 @@ fn simple_composite_fulltext() { } "#}; - psl::parse_schema(with_header(schema, crate::Provider::Mongo, &["fullTextIndex"])) + psl::parse_schema(with_header(schema, crate::Provider::Mongo, &[])) .unwrap() .assert_has_model("B") .assert_fulltext_on_fields(&["field"]); @@ -171,7 +171,7 @@ fn reformat() { } "#}; - let datamodel = with_header(schema, crate::Provider::Mongo, &["fullTextIndex"]); + let datamodel = with_header(schema, crate::Provider::Mongo, &[]); let result = psl::reformat(&datamodel, 2).unwrap_or_else(|| datamodel.to_owned()); let expected = expect![[r#" @@ -182,7 +182,6 @@ fn reformat() { generator client { provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] } type A { diff --git a/psl/psl/tests/attributes/id_negative.rs b/psl/psl/tests/attributes/id_negative.rs index bc3c9785118c..fde42fdeaafd 100644 --- a/psl/psl/tests/attributes/id_negative.rs +++ b/psl/psl/tests/attributes/id_negative.rs @@ -1004,8 +1004,7 @@ fn length_argument_does_not_work_with_int() { fn empty_fields_must_error() { let schema = r#" generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } datasource db { diff --git a/psl/psl/tests/attributes/index_negative.rs b/psl/psl/tests/attributes/index_negative.rs index 33ea015b7893..52939df7a084 100644 --- a/psl/psl/tests/attributes/index_negative.rs +++ b/psl/psl/tests/attributes/index_negative.rs @@ -361,33 +361,6 @@ fn hash_index_doesnt_work_on_sqlserver() { expectation.assert_eq(&error) } -#[test] -fn fulltext_index_no_preview_feature() { - let dml = indoc! {r#" - model A { - id Int @id - a String - b String - - @@fulltext([a, b]) - } - "#}; - - let schema = with_header(dml, Provider::Mysql, &[]); - let error = parse_unwrap_err(&schema); - - let expectation = expect![[r#" - error: Error parsing attribute "@@fulltext": You must enable `fullTextIndex` preview feature to be able to define a @@fulltext index. - --> schema.prisma:16 -  |  - 15 |  - 16 |  @@fulltext([a, b]) -  |  - "#]]; - - expectation.assert_eq(&error) -} - #[test] fn hash_index_doesnt_work_on_mysql() { let dml = indoc! {r#" @@ -426,7 +399,7 @@ fn fulltext_index_length_attribute() { } "#}; - let schema = with_header(dml, Provider::Mysql, &["fullTextIndex"]); + let schema = with_header(dml, Provider::Mysql, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -479,7 +452,7 @@ fn fulltext_index_sort_attribute() { } "#}; - let schema = with_header(dml, Provider::Mysql, &["fullTextIndex"]); + let schema = with_header(dml, Provider::Mysql, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -532,7 +505,7 @@ fn fulltext_index_postgres() { } "#}; - let schema = with_header(dml, Provider::Postgres, &["fullTextIndex"]); + let schema = with_header(dml, Provider::Postgres, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -559,7 +532,7 @@ fn fulltext_index_sql_server() { } "#}; - let schema = with_header(dml, Provider::SqlServer, &["fullTextIndex"]); + let schema = with_header(dml, Provider::SqlServer, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -586,7 +559,7 @@ fn fulltext_index_sqlite() { } "#}; - let schema = with_header(dml, Provider::Sqlite, &["fullTextIndex"]); + let schema = with_header(dml, Provider::Sqlite, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -616,7 +589,7 @@ fn only_one_fulltext_index_allowed_per_model_in_mongo() { } "#}; - let schema = with_header(dml, Provider::Mongo, &["fullTextIndex"]); + let schema = with_header(dml, Provider::Mongo, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -651,7 +624,7 @@ fn fulltext_index_fields_must_follow_each_other_in_mongo() { } "#}; - let schema = with_header(dml, Provider::Mongo, &["fullTextIndex"]); + let schema = with_header(dml, Provider::Mongo, &[]); let error = parse_unwrap_err(&schema); let expectation = expect![[r#" @@ -670,8 +643,7 @@ fn fulltext_index_fields_must_follow_each_other_in_mongo() { fn index_without_fields_must_error() { let schema = r#" generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } datasource db { diff --git a/psl/psl/tests/attributes/index_positive.rs b/psl/psl/tests/attributes/index_positive.rs index 0b5762808380..9a677656763f 100644 --- a/psl/psl/tests/attributes/index_positive.rs +++ b/psl/psl/tests/attributes/index_positive.rs @@ -304,7 +304,7 @@ fn mysql_fulltext_index() { } "#}; - psl::parse_schema(with_header(dml, Provider::Mysql, &["fullTextIndex"])) + psl::parse_schema(with_header(dml, Provider::Mysql, &[])) .unwrap() .assert_has_model("A") .assert_fulltext_on_fields(&["a", "b"]); @@ -322,7 +322,7 @@ fn mysql_fulltext_index_map() { } "#}; - psl::parse_schema(with_header(dml, Provider::Mysql, &["fullTextIndex"])) + psl::parse_schema(with_header(dml, Provider::Mysql, &[])) .unwrap() .assert_has_model("A") .assert_fulltext_on_fields(&["a", "b"]) @@ -341,7 +341,7 @@ fn fulltext_index_mongodb() { } "#}; - psl::parse_schema(with_header(dml, Provider::Mongo, &["fullTextIndex"])) + psl::parse_schema(with_header(dml, Provider::Mongo, &[])) .unwrap() .assert_has_model("A") .assert_fulltext_on_fields(&["a", "b"]); @@ -380,7 +380,7 @@ fn fulltext_index_sort_mongodb() { } "#}; - psl::parse_schema(with_header(dml, Provider::Mongo, &["fullTextIndex"])) + psl::parse_schema(with_header(dml, Provider::Mongo, &[])) .unwrap() .assert_has_model("A") .assert_fulltext_on_fields(&["a", "b"]) @@ -403,7 +403,7 @@ fn multiple_fulltext_indexes_allowed_per_model_in_mysql() { } "#}; - let schema = psl::parse_schema(with_header(dml, Provider::Mysql, &["fullTextIndex"])).unwrap(); + let schema = psl::parse_schema(with_header(dml, Provider::Mysql, &[])).unwrap(); let a = schema.assert_has_model("A"); a.assert_fulltext_on_fields(&["a", "b"]); diff --git a/psl/psl/tests/config/generators.rs b/psl/psl/tests/config/generators.rs index 20e8f8864402..36c6f6a23326 100644 --- a/psl/psl/tests/config/generators.rs +++ b/psl/psl/tests/config/generators.rs @@ -118,7 +118,7 @@ fn hidden_preview_features_setting_must_work() { let schema = indoc! {r#" generator go { provider = "go" - previewFeatures = ["fullTextIndex"] + previewFeatures = [] } "#}; @@ -133,9 +133,7 @@ fn hidden_preview_features_setting_must_work() { "output": null, "config": {}, "binaryTargets": [], - "previewFeatures": [ - "fullTextIndex" - ] + "previewFeatures": [] } ]"#]]; @@ -258,7 +256,7 @@ fn nice_error_for_unknown_generator_preview_feature() { .unwrap_err(); let expectation = expect![[r#" - error: The preview feature "foo" is not known. Expected one of: deno, driverAdapters, fullTextIndex, fullTextSearch, metrics, multiSchema, nativeDistinct, postgresqlExtensions, tracing, views, relationJoins, prismaSchemaFolder, omitApi, strictUndefinedChecks + error: The preview feature "foo" is not known. Expected one of: deno, driverAdapters, fullTextSearch, metrics, multiSchema, nativeDistinct, postgresqlExtensions, tracing, views, relationJoins, prismaSchemaFolder, omitApi, strictUndefinedChecks --> schema.prisma:3  |   2 |  provider = "prisma-client-js" diff --git a/psl/psl/tests/reformat/reformat.rs b/psl/psl/tests/reformat/reformat.rs index ffabae665400..6afc03ec6d9a 100644 --- a/psl/psl/tests/reformat/reformat.rs +++ b/psl/psl/tests/reformat/reformat.rs @@ -944,8 +944,7 @@ fn reformatting_extended_indexes_works() { fn reformatting_with_empty_indexes() { let schema = r#" generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } datasource db { @@ -966,8 +965,7 @@ fn reformatting_with_empty_indexes() { let expected = expect![[r#" generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } datasource db { diff --git a/psl/psl/tests/validation/preview_features/full_text_index/mongodb.prisma b/psl/psl/tests/validation/preview_features/full_text_index/mongodb.prisma new file mode 100644 index 000000000000..953ac28b91f4 --- /dev/null +++ b/psl/psl/tests/validation/preview_features/full_text_index/mongodb.prisma @@ -0,0 +1,22 @@ +generator client { + provider = "prisma-client-js" + previewFeatures = ["fullTextIndex"] +} + +datasource db { + provider = "mongodb" + url = env("DATABASE_URL") +} + +model Blog { + id String @id @map("_id") + content String + title String + @@fulltext([content, title]) +} +// warning: Preview feature "fullTextIndex" is deprecated. The functionality can be used without specifying it as a preview feature. +// --> schema.prisma:3 +//  |  +//  2 |  provider = "prisma-client-js" +//  3 |  previewFeatures = ["fullTextIndex"] +//  |  diff --git a/psl/psl/tests/validation/preview_features/full_text_index/mysql.prisma b/psl/psl/tests/validation/preview_features/full_text_index/mysql.prisma new file mode 100644 index 000000000000..76a15eb4f5eb --- /dev/null +++ b/psl/psl/tests/validation/preview_features/full_text_index/mysql.prisma @@ -0,0 +1,22 @@ +generator client { + provider = "prisma-client-js" + previewFeatures = ["fullTextIndex"] +} + +datasource db { + provider = "mysql" + url = env("DATABASE_URL") +} + +model Blog { + id Int @unique + content String + title String + @@fulltext([content, title]) +} +// warning: Preview feature "fullTextIndex" is deprecated. The functionality can be used without specifying it as a preview feature. +// --> schema.prisma:3 +//  |  +//  2 |  provider = "prisma-client-js" +//  3 |  previewFeatures = ["fullTextIndex"] +//  |  diff --git a/query-engine/dmmf/test_files/indexes_mongodb.prisma b/query-engine/dmmf/test_files/indexes_mongodb.prisma index e73d7f4033f3..e63129d54f0f 100644 --- a/query-engine/dmmf/test_files/indexes_mongodb.prisma +++ b/query-engine/dmmf/test_files/indexes_mongodb.prisma @@ -4,8 +4,7 @@ datasource db { } generator client { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } model Post { diff --git a/schema-engine/connectors/mongodb-schema-connector/src/client_wrapper.rs b/schema-engine/connectors/mongodb-schema-connector/src/client_wrapper.rs index b2da59b73986..7e9996fe258f 100644 --- a/schema-engine/connectors/mongodb-schema-connector/src/client_wrapper.rs +++ b/schema-engine/connectors/mongodb-schema-connector/src/client_wrapper.rs @@ -9,11 +9,10 @@ use schema_connector::{ConnectorError, ConnectorResult}; pub struct Client { inner: mongodb::Client, db_name: String, - preview_features: BitFlags, } impl Client { - pub async fn connect(connection_str: &str, preview_features: BitFlags) -> ConnectorResult { + pub async fn connect(connection_str: &str, _preview_features: BitFlags) -> ConnectorResult { let MongoConnectionString { database, .. } = connection_str.parse().map_err(ConnectorError::url_parse_error)?; let inner = mongodb_client::create(connection_str) @@ -26,7 +25,6 @@ impl Client { Ok(Client { inner, db_name: database, - preview_features, }) } @@ -39,9 +37,7 @@ impl Client { .await .map_err(mongo_error_to_connector_error)?; - if !self.preview_features.contains(PreviewFeature::FullTextIndex) { - schema.remove_fulltext_indexes(); - } + schema.remove_fulltext_indexes(); Ok(schema) } diff --git a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/composite_indexes_work_on_arrays/schema.prisma b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/composite_indexes_work_on_arrays/schema.prisma index 6dfdf46f9ddc..62a930e5c990 100644 --- a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/composite_indexes_work_on_arrays/schema.prisma +++ b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/composite_indexes_work_on_arrays/schema.prisma @@ -4,8 +4,7 @@ datasource db { } generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } type Address { diff --git a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_fulltext_indexes_can_be_created/schema.prisma b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_fulltext_indexes_can_be_created/schema.prisma index 2b53d5fc0fb2..4e378581f480 100644 --- a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_fulltext_indexes_can_be_created/schema.prisma +++ b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_fulltext_indexes_can_be_created/schema.prisma @@ -4,8 +4,7 @@ datasource db { } generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } type Address { diff --git a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_changed/schema.prisma b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_changed/schema.prisma index 63740be54424..2b4191562106 100644 --- a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_changed/schema.prisma +++ b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_changed/schema.prisma @@ -4,8 +4,7 @@ datasource db { } generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } model User { diff --git a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_created/schema.prisma b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_created/schema.prisma index 665ad04292af..d8eed5f54269 100644 --- a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_created/schema.prisma +++ b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/multi_column_mixed_fulltext_indexes_can_be_created/schema.prisma @@ -4,8 +4,7 @@ datasource db { } generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } model User { diff --git a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/single_column_fulltext_indexes_can_be_created/schema.prisma b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/single_column_fulltext_indexes_can_be_created/schema.prisma index 4ec7ee068d73..aa6f5afa723a 100644 --- a/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/single_column_fulltext_indexes_can_be_created/schema.prisma +++ b/schema-engine/connectors/mongodb-schema-connector/tests/migrations/scenarios/single_column_fulltext_indexes_can_be_created/schema.prisma @@ -4,8 +4,7 @@ datasource db { } generator js { - provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] + provider = "prisma-client-js" } model User { diff --git a/schema-engine/connectors/sql-schema-connector/src/flavour.rs b/schema-engine/connectors/sql-schema-connector/src/flavour.rs index 3b2e901bcd67..fa7b8a88ecdc 100644 --- a/schema-engine/connectors/sql-schema-connector/src/flavour.rs +++ b/schema-engine/connectors/sql-schema-connector/src/flavour.rs @@ -309,11 +309,6 @@ fn validate_connection_infos_do_not_match(previous: &str, next: &str) -> Connect /// Remove all usage of non-enabled preview feature elements from the SqlSchema. fn normalize_sql_schema(sql_schema: &mut SqlSchema, preview_features: BitFlags) { - // Remove this when the feature is GA - if !preview_features.contains(PreviewFeature::FullTextIndex) { - sql_schema.make_fulltext_indexes_normal(); - } - if !preview_features.contains(PreviewFeature::MultiSchema) { sql_schema.clear_namespaces(); } diff --git a/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/index.rs b/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/index.rs index 6d563d61e204..63df8855a754 100644 --- a/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/index.rs +++ b/schema-engine/connectors/sql-schema-connector/src/introspection/introspection_pair/index.rs @@ -2,7 +2,6 @@ use psl::{ datamodel_connector::constraint_names::ConstraintNames, parser_database::{walkers, IndexType}, schema_ast::ast, - PreviewFeature, }; use sql::{mssql::MssqlSchemaExt, postgres::PostgresSchemaExt}; use sql_schema_describer as sql; @@ -58,12 +57,7 @@ impl<'a> IndexPair<'a> { /// The type of the index. pub(crate) fn index_type(self) -> sql::IndexType { - let preview_features = self.context.config.preview_features(); - match self.next.map(|next| next.index_type()) { - Some(sql::IndexType::Fulltext) if !preview_features.contains(PreviewFeature::FullTextIndex) => { - sql::IndexType::Normal - } Some(typ) => typ, None => match self.previous.map(|prev| prev.index_type()) { Some(IndexType::Unique) => sql::IndexType::Unique, diff --git a/schema-engine/sql-introspection-tests/tests/tables/mysql.rs b/schema-engine/sql-introspection-tests/tests/tables/mysql.rs index 2ced8d9044ac..912512a1d854 100644 --- a/schema-engine/sql-introspection-tests/tests/tables/mysql.rs +++ b/schema-engine/sql-introspection-tests/tests/tables/mysql.rs @@ -221,7 +221,7 @@ async fn a_table_with_descending_unique(api: &mut TestApi) -> TestResult { Ok(()) } -#[test_connector(tags(Mysql), preview_features("fullTextIndex"))] +#[test_connector(tags(Mysql))] async fn a_table_with_fulltext_index(api: &mut TestApi) -> TestResult { let setup = indoc! {r#" CREATE TABLE `A` ( @@ -250,7 +250,7 @@ async fn a_table_with_fulltext_index(api: &mut TestApi) -> TestResult { Ok(()) } -#[test_connector(tags(Mysql), preview_features("fullTextIndex"))] +#[test_connector(tags(Mysql))] async fn a_table_with_fulltext_index_with_custom_name(api: &mut TestApi) -> TestResult { let setup = indoc! {r#" CREATE TABLE `A` ( diff --git a/schema-engine/sql-migration-tests/tests/migrations/indexes.rs b/schema-engine/sql-migration-tests/tests/migrations/indexes.rs index 77badfd061e4..cbb2496af639 100644 --- a/schema-engine/sql-migration-tests/tests/migrations/indexes.rs +++ b/schema-engine/sql-migration-tests/tests/migrations/indexes.rs @@ -854,14 +854,13 @@ fn removal_index_length_prefix_should_not_happen_without_preview_feature(api: Te api.schema_push_w_datasource(dm).send().assert_no_steps(); } -#[test_connector(tags(Mysql), preview_features("fullTextIndex"))] +#[test_connector(tags(Mysql))] fn fulltext_index(api: TestApi) { let dm = formatdoc! {r#" {} generator client {{ provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] }} model A {{ @@ -880,7 +879,7 @@ fn fulltext_index(api: TestApi) { }); } -#[test_connector(tags(Mysql), preview_features("fullTextIndex"))] +#[test_connector(tags(Mysql))] fn fulltext_index_with_map(api: TestApi) { let dm = indoc! {r#" datasource db { @@ -890,7 +889,6 @@ fn fulltext_index_with_map(api: TestApi) { generator client { provider = "prisma-client-js" - previewFeatures = ["fullTextIndex"] } model A { @@ -936,7 +934,7 @@ fn do_not_overwrite_fulltext_index_without_preview_feature(api: TestApi) { api.schema_push_w_datasource(dm).send().assert_no_steps(); } -#[test_connector(tags(Mysql), preview_features("fullTextIndex"))] +#[test_connector(tags(Mysql))] fn adding_fulltext_index_to_an_existing_column(api: TestApi) { let dm = indoc! {r#" model A { @@ -968,7 +966,7 @@ fn adding_fulltext_index_to_an_existing_column(api: TestApi) { }); } -#[test_connector(tags(Mysql), exclude(Mysql56), preview_features("fullTextIndex"))] +#[test_connector(tags(Mysql), exclude(Mysql56))] fn changing_normal_index_to_a_fulltext_index(api: TestApi) { let dm = indoc! {r#" model A {