firebase mysql,将MySQL迁移到Firebase

So i have an application which currently stores data on an apache server and mysql. I want to migrate to firebase but i have the following problem:

My data is a Business table where each user has stored their data. This includes their email and all the data of their business (address, city, business name, etc.) I have exported the data in json and import it to firebase, but now i want the users to create a new profile (in firebase) and then "claim" their data.

This should be done in order to create a relationship between the user and the business.

Any ideas on how to do that?

EDITED:

So the problem was that i had the business and my user in one object or table like this:

{

"user_type": "Hotel",

"state": "Lakonia",

"postcode": "23100",

"city": "Mystras",

"country": "Greece",

"id": 1,

"num_of_rooms": "5",

"email": "info@email.com",

"address": "Something",

"time_of_register": "",

"name": "My hotel",

"latlng": ""

}

In order to migrate it to Firebase, I created a check, so when a user logs in, the system runs a query and if the users registration email is the same with one of the businesses, i move it to a new firebase data set, registered with the users unique key. Thus no i have two sets, one for my users and one for the business info.

解决方案

Should be fairly straight forward

Users

User_id_0

Name: frank

Business_ref: Business_id_0

User_Id_1

Name: buzz

Business_ref: Business_id_1

Businesses

Business_id_0

Business_name: Code'r' us

Owner: User_id_0

Business_id_1

Business_name: Burger Boooyaa

Owner: User_id_1

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值