简体   繁体   English

为firebase登台和生产数据库创建“蓝图”?

[英]Creating “blueprints” for firebase staging and production databases?

Assume we worked on a staging real time database during development, it shaped up to be big and complex structure json. 假设我们在开发过程中使用了一个临时的实时数据库,它的形状就变得庞大而复杂。 Is there any way to define blueprint for firebase's real time database so that structure from staging database can be moved to production, without data that is currently in staging database? 有什么方法可以为Firebase的实时数据库定义蓝图,以便可以将暂存数据库中的结构移到生产环境中,而无需暂存数据库中当前存在数据?

The Firebase Database is a schemaless database. Firebase数据库是无模式数据库。 If you remove the actual values from the database, nothing will be left. 如果从数据库中删除实际值,将什么也不会留下。 So there also won't be anything to clone in that case. 因此,在这种情况下也不会克隆任何内容。

Any rules about the data structure (validation) and access permissions are captured in Firebase's security rules . Firebase的安全规则中捕获了有关数据结构(验证)和访问权限的所有规则 If you define those in a separate file, you can use the Firebase CLI to deploy them to either environment. 如果您在单独的文件中定义它们,则可以使用Firebase CLI将它们部署到任一环境中。 See this for how to do that: How do I deploy Firebase Database Security rules using the command line? 请参阅此内容以了解如何执行此操作: 如何使用命令行部署Firebase数据库安全性规则?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM